Here you can find the source of hasChildren(Element e)
public static boolean hasChildren(Element e)
//package com.java2s; // it under the terms of the GNU Affero General Public License as import org.w3c.dom.Element; public class Main { public static boolean hasChildren(Element e) { if (e == null) return false; return e.getFirstChild() != null; }//w w w. ja va 2 s.c o m }