Java tutorial
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /** * Find child element by name * @param element parent element * @param childName child name * @return */ public static Element findChildElement(Element element, String childName) { for (Node child = element.getFirstChild(); child != null; child = child.getNextSibling()) { if (child instanceof Element && childName.equals(child.getNodeName())) { return (Element) child; } } return null; } }