Java tutorial
//package com.java2s; //License from project: Apache License import org.w3c.dom.Document; import org.w3c.dom.Node; public class Main { /** * This method creates a new textnode with the passed on value. * * @param sValue The value for the new textnode. * @param nParent The parent node. */ public static void createText(String sValue, Node nParent) { if (nParent != null) { Document dDoc = nParent.getOwnerDocument(); Node nTemp = dDoc.createTextNode(sValue); nParent.appendChild(nTemp); } } }