Java tutorial
//package com.java2s; import org.w3c.dom.*; public class Main { private static void addTextContent(Document doc, Element root, String param, String value) { Element ele = doc.createElement(param); ele.setTextContent(value); root.appendChild(ele); } }