Node.hasChildNodes()
To test whether a node N has any child nodes:
N
N.hasChildNodes()
Returns true if there are child nodes, false otherwise.