Here you can find the source of getNodeText(Node node)
public static String getNodeText(Node node)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getNodeText(Node parentNode, String nodeName) { Element fstElmnt = (Element) parentNode; NodeList fstNmElmntLst = fstElmnt.getElementsByTagName(nodeName); Element fstNmElmnt = (Element) fstNmElmntLst.item(0); NodeList fstNm = fstNmElmnt.getChildNodes(); String ret = fstNm.item(0).getNodeValue(); return ret; }/*w w w. j a v a 2 s .c o m*/ public static String getNodeText(Node node) { NodeList fstNm = ((Element) node).getChildNodes(); String ret = fstNm.item(0).getNodeValue(); return ret; } }