title: Sum of node value and attribute multiplied by using XPATH
body: <p>Say you have an XML that looks like this:</p>
  
  <pre><code>&lt;scores&gt;
      &lt;score cnt="2"&gt;10&lt;/score&gt;
      &lt;score cnt="0"&gt;20&lt;/score&gt;
      &lt;score cnt="1"&gt;50&lt;/score&gt;
  &lt;/scores&gt;
  </code></pre>
  
  <p>What I would like to get is the total sum which should be 70 = (2*10 + 1*50). So, multiplication between the node value and it's attribute and the final sum of all the nodes.</p>
  
  <p>Sure enough I know how to make a sum of just values: <code>sum(//score)</code>, or attributes <code>sum(//score/@cnt)</code> but I can't figure out how to put these two together. How could this be done?</p>