Here you can find the source of getFirstElementChild(Element parent)
static Element getFirstElementChild(Element parent)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /** Finds the first element child, or null if not found. */ static Element getFirstElementChild(Element parent) { for (Node n = parent.getFirstChild(); n != null; n = n.getNextSibling()) { if (n.getNodeType() == Node.ELEMENT_NODE) return (Element) n; }/* w ww . j av a2 s .c o m*/ return null; } }