title: How to use sum function in XPath?
body: <p>I have an xml file with following contents:</p>
  
  <pre><code>&lt;Xavor&gt;
  &lt;Dev&gt;
      &lt;Emp&gt;1&lt;/Emp&gt;
      &lt;Floor&gt;1&lt;/Floor&gt;
      &lt;Salary&gt;1200.4&lt;/Salary&gt;
  &lt;/Dev&gt;
  &lt;Dev&gt;
      &lt;Emp&gt;2&lt;/Emp&gt;
      &lt;Salary&gt;3100.8&lt;/Salary&gt;
  &lt;/Dev&gt;
  &lt;Dev&gt;
      &lt;Emp&gt;3&lt;/Emp&gt;
      &lt;Floor&gt;1&lt;/Floor&gt;
  &lt;/Dev&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want to calculate sum of salaries of first two Employees using sum function. I came to this XPath:</p>
  
  <pre><code>sum(/Xavor/Dev[2]/Salary/text())
  </code></pre>
  
  <p>But this returns only second salary value ie <code>3100.8</code>!!!
  This XPath was working fine when there were only non-floating point numbers were in salaries. Please help me out.</p>