Here you can find the source of getChildNode(Element item, String name)
static public Element getChildNode(Element item, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.*; public class Main { static public Element getChildNode(Element item, String name) { NodeList children = item.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node thisItem = (Node) children.item(i); if (thisItem != null && thisItem.getNodeName().equals(name) && thisItem.getParentNode() == item) { return (Element) thisItem; }//ww w .j a v a 2 s . com } return null; } }