Here you can find the source of getChildElement(Element elem, String name)
public static Element getChildElement(Element elem, String name)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Element getChildElement(Element elem, String name) { NodeList nodes = elem.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node.getNodeType() == Node.ELEMENT_NODE && node.getNodeName().equals(name)) { return (Element) node; }/* w w w . j a v a 2 s .c o m*/ } return null; } }