Here you can find the source of findChildElement(Element parent, String name)
public static Element findChildElement(Element parent, String name)
//package com.java2s; import org.w3c.dom.Element; public class Main { public static Element findChildElement(Element parent, String name) { if (parent == null) { return null; }//from ww w . j a v a 2s.c om org.w3c.dom.Node ret = parent.getFirstChild(); while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals( name))) { ret = ret.getNextSibling(); } return (Element) ret; } }