title: XPath to count the child nodes based on complex filter
body: <p>I have an XML in the following format:</p>
  
  <pre><code>&lt;ComRequest&gt;
    &lt;root lineId="1" creator="jumnix"&gt;
      &lt;component lineId="101"&gt;
          &lt;compLine lineId="1001"&gt;1&lt;/compLine&gt;
          &lt;compLine lineId="1002"&gt;2&lt;/compLine&gt;
          &lt;compLine lineId="1003"&gt;3&lt;/compLine&gt;
          &lt;compLine lineId="1004"&gt;4&lt;/compLine&gt;
          &lt;compLine lineId="1005"&gt;5&lt;/compLine&gt;
          &lt;compLine lineId="1006"&gt;6&lt;/compLine&gt;
          &lt;compLine lineId="1007"&gt;7&lt;/compLine&gt;
          &lt;compLine lineId="1008"&gt;8&lt;/compLine&gt;
          &lt;compLine lineId="1009"&gt;9&lt;/compLine&gt;
          &lt;compLine lineId="1010"&gt;10&lt;/compLine&gt;
          &lt;compLine lineId="1011"&gt;11&lt;/compLine&gt;
      &lt;/component&gt;
      &lt;component lineId="102"&gt;
          &lt;compLine lineId="1012"&gt;12&lt;/compLine&gt;
          &lt;compLine lineId="1013"&gt;13&lt;/compLine&gt;
          &lt;compLine lineId="1014"&gt;14&lt;/compLine&gt;
          &lt;compLine lineId="1015"&gt;15&lt;/compLine&gt;
          &lt;compLine lineId="1016"&gt;16&lt;/compLine&gt;
          &lt;compLine lineId="1017"&gt;17&lt;/compLine&gt;
          &lt;compLine lineId="1018"&gt;18&lt;/compLine&gt;
          &lt;compLine lineId="1019"&gt;19&lt;/compLine&gt;
          &lt;compLine lineId="1020"&gt;20&lt;/compLine&gt;
          &lt;compLine lineId="1021"&gt;21&lt;/compLine&gt;
          &lt;compLine lineId="1022"&gt;22&lt;/compLine&gt;
      &lt;/component&gt;
    &lt;/root&gt;
  &lt;/ComRequest&gt;
  </code></pre>
  
  <p>I have a requirement to get the count of the 'component' nodes that have more than 10 'compLine' elements. Till now I have the following XPath query - </p>
  
  <pre><code>count(//*[local-name()='ComRequest']/*[local-name()='root']/*[local-name()='component']/*[local-name()='compLine' and count(self) gt 10])
  </code></pre>
  
  <p>But this does not work (gives a '0' result). Any help in getting this resolved is appreciated.</p>