title: Counting unique XML element attributes using XSLT
body: <p>I've just started using XSLT and am trying to figure this out.
  Your help would be greatly appreciated.</p>
  
  <p>Example XML file</p>
  
  <pre><code>&lt;purchases&gt;
      &lt;item id = "1" customer_id = "5"&gt;
      &lt;/item&gt;
      &lt;item id = "2" customer_id = "5"&gt;
      &lt;/item&gt;
      &lt;item id = "7" customer_id = "4"&gt;
      &lt;/item&gt;
  &lt;/purchases&gt;
  </code></pre>
  
  <p>Desired HTML Output:</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;&lt;th&gt;Customer ID&lt;/th&gt;&lt;th&gt;Number of Items Purchased&lt;/th&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Customer with id number 5 has bought 2 items.
  Customer with id number 4 has bought 1 item.</p>