Here you can find the source of getFirstChild(Element element)
public static Element getFirstChild(Element element)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static Element getFirstChild(Element element) { NodeList nodelist = element.getChildNodes(); for (int i = 0; i < nodelist.getLength(); i++) { Node node = nodelist.item(i); if (node instanceof Element) return (Element) node; }/*w w w .ja v a 2s.c o m*/ return null; } }