Here you can find the source of setTextContent(Node node, String string)
public static void setTextContent(Node node, String string)
//package com.java2s; import org.w3c.dom.Node; public class Main { public static void setTextContent(Node node, String string) { // This would just be node.setTextContent(string) in API level >= 2.2 node.appendChild(node.getOwnerDocument().createTextNode(string)); }/* w ww . ja v a 2 s. c om*/ }