title: How do I use XPath to count the number of nodes with a certain attribute
body: <p>I can't seem to get an XPath expression to work for my scenario. I want to find all the "Device" nodes that have the type "EndDevice". I'm able to count all the "Device" nodes, and I'm also able to find all "Device" nodes with the "EndDevice" attribute. However, I can't seem to combine them!</p>
  
  <pre><code>count(//Device) //works
  //Device[@xsi:type='EndDevice'] //works
  count(//Device[@xsi:type='EndDevice']) //doesn't work
  </code></pre>
  
  <p>If it matters, I'm using XPathBuilder.</p>