Here you can find the source of getElementText(Element element)
public static String getElementText(Element element)
//package com.java2s; //License from project: MIT License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static String getElementText(Element element) { StringBuilder text = new StringBuilder(); NodeList childNodes = element.getChildNodes(); int numChildren = childNodes.getLength(); for (int j = 0; j < numChildren; j++) { text.append(childNodes.item(j).getNodeValue()); }/*www .j a v a 2 s . c o m*/ return text.toString(); } }