Here you can find the source of addTextElement(Document doc, String name, String value, Element parent)
public static Element addTextElement(Document doc, String name, String value, Element parent)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { public static Element addTextElement(Document doc, String name, String value, Element parent) { Element child = doc.createElement(name); child.appendChild(doc.createTextNode(value)); parent.appendChild(child);//from ww w .ja v a 2s .c om return child; } }