Here you can find the source of getChild(Node node, String name)
public static Element getChild(Node node, String name)
//package com.java2s; //License from project: BSD License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Element getChild(Node node, String name) { NodeList list = node.getChildNodes(); int count = list.getLength(); for (int i = 0; i < count; i++) { Node n = list.item(i); if (n.getNodeType() != Node.ELEMENT_NODE) continue; if (n.getNodeName().equalsIgnoreCase(name)) return (Element) n; }//from ww w .j a v a2s .com return null; } }