title: Counting nodes with certain attribute values in XSLT
body: <p>Suppose I have some XML like this:</p>
  
  <pre><code>    &lt;section name="SampleSection"&gt;
          &lt;item name="ScoredItem1"&gt;
              &lt;attributes&gt;
                  &lt;scored data_type="boolean" value="true"/&gt;
              &lt;/attributes&gt;
          &lt;/item&gt;
          &lt;item name="UnscoredItem1"&gt;
              &lt;attributes&gt;
                  &lt;scored data_type="boolean" value="false"/&gt;
              &lt;/attributes&gt;
          &lt;/item&gt;
          &lt;item key="(3272fbb5:22)" name="ScoredItem2"&gt;
              &lt;attributes&gt;
                  &lt;scored data_type="boolean" value="true"/&gt;
              &lt;/attributes&gt;
          &lt;/item&gt;
      &lt;/section&gt;
  </code></pre>
  
  <p>Now, I know, using XSLT, I can count the items that have a <code>scored</code> <code>attribute</code> like this:</p>
  
  <pre><code>&lt;xsl:variable name="scoredItems" select="item/attributes/scored"/&gt;
  &lt;xsl:value-of select="count($scoredItems)"/&gt;
  </code></pre>
  
  <p>This will give me a value of 3, of course.</p>
  
  <p>Suppose I only want to count those items for which <code>scored</code> is <code>true</code>.  How do I do that using XSLT?  (This should return a value of 2 for this example.</p>