title: xquery/xpath- how to get number of descendant nodes of a particular type
body: <p>Take a look at the sample XML below--</p>
  
  <pre><code>&lt;div id="main"&gt;
      &lt;div id="1"&gt;
          Some random text
      &lt;/div&gt;
      &lt;div id="2"&gt;
          Some random text
      &lt;/div&gt;
      &lt;div id="3"&gt;
          Some random text
      &lt;/div&gt;
      &lt;p&gt; Some more random text&lt;/p&gt;
      &lt;div id="4"&gt;
          Some random text
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now, how do I find out the number of divs within the main div using Xquery? And how to do this in XPath?</p>