Here you can find the source of getFirstElementChild(Element element)
public static Element getFirstElementChild(Element element)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element getFirstElementChild(Element element) { Node child = element.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) return (Element) child; child = child.getNextSibling(); }//from w ww.j a v a2 s .c o m return null; } }