Khi tạo một tài liệu XML khác biệt là gì (nếu có) giữa hai phương pháp này thêm văn bản vào một phần tử:Sự khác nhau giữa setTextContent() và appendChild (Text)
Element el = document.createElement("element");
el.setTextContent("This is the text content");
và
Element el = document.createElement("element");
Text txt = document.createTextNode("This is the text content");
el.appendChild(txt);