Here you can find the source of findNodeValue(Element firstElement, String name)
public static String findNodeValue(Element firstElement, String name)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { public static String findNodeValue(Element firstElement, String name) { String nodeValue = null;//from w w w . j a va2 s. c om NodeList firstNameList = firstElement.getElementsByTagName(name); Element firstNameElement = (Element) firstNameList.item(0); NodeList textFNList = firstNameElement.getChildNodes(); if (textFNList.getLength() > 0) { nodeValue = (textFNList.item(0)).getNodeValue(); } return nodeValue; } }