Here you can find the source of createTextElement(Document d, String textElementName, String textElementValue)
protected static Element createTextElement(Document d, String textElementName, String textElementValue)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { protected static Element createTextElement(Document d, String textElementName, String textElementValue) { Element placeName = d.createElement(textElementName); Element placeNameText = d.createElement("text"); placeNameText.setTextContent(textElementValue); placeName.appendChild(placeNameText); return placeName; }/*from w w w.jav a 2 s . co m*/ }