public static boolean hasChildElements ( Node node ) { NodeList nlist = node . getChildNodes ( ) ; for ( int i = 0 ; i < nlist . getLength ( ) ; i ++ ) { Node child = nlist . item ( i ) ; if ( child . getNodeType ( ) == Node . ELEMENT_NODE ) return true ; } return false ; }
True if the node has child elements