Here you can find the source of hasChildren(final Node node)
public static final boolean hasChildren(final Node node)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Node; public class Main { public static final boolean hasChildren(final Node node) { return node == null ? false : node.hasChildNodes(); }//from ww w. ja va2 s . c om }