Here you can find the source of getFirstChildElement(Node node)
public static Element getFirstChildElement(Node node)
//package com.java2s; import org.w3c.dom.Node; import org.w3c.dom.Element; public class Main { public static Element getFirstChildElement(Node node) { return getNthChildElement(node, 0); }//from w ww.j a v a2s.c om public static Element getNthChildElement(Node node, int index) { int i = 0; Node child = node.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { if (index == i) { return (Element) child; } ++i; } child = child.getNextSibling(); } return null; } }