title: How to get Count of child nodes using XPATH for XML
body: <p>i have an XML file with multiple nodes as below :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;bookstore&gt;
  
  &lt;book category="cooking"&gt;
    &lt;title lang="en"&gt;Everyday Italian&lt;/title&gt;
    &lt;author&gt;Giada De Laurentiis&lt;/author&gt;
    &lt;year&gt;2005&lt;/year&gt;
    &lt;price&gt;30.00&lt;/price&gt;
  &lt;/book&gt;
  
  &lt;book category="eating"&gt;
     &lt;title lang="en"&gt;Everyday Italian&lt;/title&gt;
     &lt;author&gt;Giada&lt;/author&gt;
     &lt;year&gt;2015&lt;/year&gt;
  &lt;/book&gt;
  
  &lt;/bookstore&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>i want the count of child node in book with category cooking using XPATH . </p>
  
  <p>like for the above example the count of child node with attribute cooking is 4</p>