Here you can find the source of getTextValue(Element el, String tagName)
public static String getTextValue(Element el, String tagName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; public class Main { public static String getTextValue(Element el, String tagName) { String textVal = null;/*from w w w.j av a2s . c om*/ NodeList nl = el.getElementsByTagName(tagName); if (nl != null && nl.getLength() > 0) { Element e = (Element) nl.item(0); textVal = e.getFirstChild().getNodeValue(); } return textVal; } }