Here you can find the source of appendTextNode(String tagName, String textContent, Document doc)
public static Element appendTextNode(String tagName, String textContent, Document doc)
//package com.java2s; import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { public static Element appendTextNode(String tagName, String textContent, Document doc) { Element textNode = doc.createElement(tagName); textNode.setTextContent(textContent); return textNode; }/*from www.j a v a2 s .c o m*/ }