Here you can find the source of getElementValue(Node elem)
public final static String getElementValue(Node elem)
//package com.java2s; import org.w3c.dom.Node; public class Main { public final static String getElementValue(Node elem) { Node kid;/*www .j a va 2s.c o m*/ if (elem != null) { if (elem.hasChildNodes()) { for (kid = elem.getFirstChild(); kid != null; kid = kid .getNextSibling()) { if (kid.getNodeType() == Node.TEXT_NODE) { return kid.getNodeValue(); } } } } return ""; } }