title: How to check if NodeList contains any children?
body: <p>Is there an easy and simple way to check if a NodeList that I evaluate from an xpath actually contains any child nodes, or if it's just empty tags?
  Take this simple xml as an example:</p>
  
  <pre><code>&lt;shop&gt;
    &lt;shoes&gt;brand1&lt;/shoes&gt;
    &lt;tshirt&gt;brand2&lt;/tshirt&gt;
    &lt;socks&gt;brand3&lt;/socks&gt;
  &lt;/shop&gt;
  </code></pre>
  
  <p>If I run</p>
  
  <pre><code> NodeList nodeList = (NodeList) path.evaluate("/shop", myDocument, XPathConstants.NODESET);
  </code></pre>
  
  <p>I'll get a nice NodeList that I can extract the various shoes, tshirt and socks values from. That's fine. But what if I have an xml that looks like this:</p>
  
  <pre><code>&lt;shop&gt;
  &lt;/shop&gt;
  </code></pre>
  
  <p>Running the same command will give me a NodeList of length 1, and I'd rather not continue with the extraction process if I already know it contains nothing.</p>
  
  <p>Other than checking if <code>nodeList.item(0).getChildNodes().getLength() == 1</code>, is there another way to check for empty childNodes?</p>