Here you can find the source of getChildNode(Node node, String nodeName)
public static Node getChildNode(Node node, String nodeName)
//package com.java2s; //License from project: BSD License import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Node getChildNode(Node node, String nodeName) { if (node.getNodeType() == Node.ELEMENT_NODE) { NodeList nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node n = nodeList.item(i); if (n.getNodeName().equals(nodeName)) { return n; }//from ww w . j a va 2 s . c o m } } return null; } }