Here you can find the source of getFirstChildElement(Node node)
public static Node getFirstChildElement(Node node)
//package com.java2s; // License as published by the Free Software Foundation; either import org.w3c.dom.Node; public class Main { public static Node getFirstChildElement(Node node) { Node firstChildElement = null; for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) { if (child.getNodeType() != Node.TEXT_NODE) { firstChildElement = child; break; }/*from ww w . ja va2s.co m*/ } return firstChildElement; } }