title: Getting a count of attributes with a given value
body: <p>I'm trying to construct <code>XQuery</code> that will return the count of the number attributes found that have a value of <code>x</code>.</p>
  
  <p>This is part of <code>SQL</code> query and these counts will fill one of the columns returned (that part I can figure out, it's the actual <code>XQuery</code> to get the count I haven't figured out yet.)  </p>
  
  <p>For example, if I have <code>&lt;element elementattribute=1&gt;...&lt;/element&gt;</code>, how would I count all the <code>@elementattributes</code> that equal 1 for a given chunk of <code>XML</code>?</p>