Here you can find the source of getText(Element element, String tagName)
public static String getText(Element element, String tagName)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; public class Main { public static String getText(Element element, String tagName) { return element.getElementsByTagName(tagName).item(0).getTextContent(); }//from ww w. jav a 2 s.co m }