title: XSLT SUM() not working as expected
body: <p>I've been trying to get the sum (total) value for elements in different nodes, but after a week messing around with example after example I am no step closer to the solution.</p>
  
  <p>All I get is the different values listed in a string rather than the sum.</p>
  
  <p>The selection used to get the values is:</p>
  
  <pre><code>&lt;xsl:for-each select="//workgroups/workgroup/agentstatus/status"&gt;
    &lt;xsl:if test="key='Available, No ACD'"&gt;
      &lt;xsl:value-of select="sum(value)"/&gt;
    &lt;/xsl:if&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>This returns <code>111</code> rather than the expected value <code>3</code></p>
  
  <p>What do I do wrong here?</p>
  
  <p>This is xml version="1.0" encoding='utf-8'</p>