Here you can find the source of getChildElementText(Node element, String childNodeName)
public static String getChildElementText(Node element, String childNodeName)
//package com.java2s; import org.w3c.dom.Node; public class Main { public static String getChildElementText(Node element, String childNodeName) { Node child = getChildElement(element, childNodeName); if (child != null) { return child.getTextContent(); }/* ww w. j av a 2s. c om*/ return null; } public static Node getChildElement(Node element, String childNodeName) { for (int i = 0; i < element.getChildNodes().getLength(); i++) { Node child = element.getChildNodes().item(i); if (child.getNodeName().equals(childNodeName)) { return child; } } return null; } }