title: jQuery XML: Count number of leaf nodes
body: <p>How can I count the number of leaf nodes coming off a particular XML node using jQuery?
  The XML in question looks similar to this.  I want all leaf nodes coming off the <code>&lt;Errors&gt;</code> node.</p>
  
  <pre><code>&lt;Errors&gt;
      &lt;ErrorParentCat&gt;
          &lt;ErrorTag/&gt;
          &lt;ErrorTag2/&gt;
      &lt;/ErrorParentCat&gt;
  &lt;/Errors&gt;
  </code></pre>
  
  <p>In this example I want <code>&lt;ErrorTag/&gt;</code> and <code>&lt;ErrorTag2/&gt;</code> counted only.  The result should therefore be <code>2</code>.  Also <code>&lt;ErrorParentCat&gt;</code> is an example tag, there could be many within <code>&lt;Errors&gt;</code> with different names.</p>
  
  <p>Once I have the number I would like a list of these leaf nodes too, if possible.</p>