Here you can find the source of setTextContent(Node n, String s)
public static void setTextContent(Node n, String s)
//package com.java2s; import org.w3c.dom.*; public class Main { public static Document d; public static void setTextContent(Node n, String s) { n.appendChild(d.createTextNode(s)); }//from w w w. j a v a 2 s . c o m }