Here you can find the source of getValue(Element element)
public static String getValue(Element element)
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getValue(Element element) { NodeList l = element.getChildNodes(); StringBuffer s = new StringBuffer(); for (int i = 0; i < l.getLength(); i++) { switch (l.item(i).getNodeType()) { case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: s.append(l.item(i).getNodeValue()); }/* w w w .j a v a 2 s . c om*/ } return s.toString(); } }