XML ドキュメントを作成する場合、要素にテキストを追加するこれら 2 つの方法の違いは何ですか (ある場合):
Element el = document.createElement("element");
el.setTextContent("This is the text content");
と
Element el = document.createElement("element");
Text txt = document.createTextNode("This is the text content");
el.appendChild(txt);