title: XSL/XPATH sum of two nodes based on a condition
body: <p>Here is my sample XML looks like</p>
  
  <pre><code>&lt;Header&gt;
  &lt;id&gt; 1234 &lt;id&gt;
  &lt;type&gt; abcd &lt;type&gt;
  &lt;account&gt;
      &lt;code1&gt;a11 &lt;/code1&gt;
      &lt;code2&gt;a12 &lt;/code2&gt;
      &lt;expense&gt;
          &lt;cost&gt; 10 &lt;/cost&gt;
          &lt;description&gt; Travel &lt;/description&gt;
      &lt;/expense&gt;
          &lt;expense&gt;
          &lt;cost&gt; 30 &lt;/cost&gt;
          &lt;description&gt; Travel &lt;/description&gt;
      &lt;/expense&gt;
      &lt;expense&gt;
          &lt;cost&gt; 20 &lt;/cost&gt;
          &lt;description&gt; Hotel &lt;/description&gt;
      &lt;/expense&gt;
          &lt;expense&gt;
          &lt;cost&gt; 10 &lt;/cost&gt;
          &lt;description&gt; Hotel &lt;/description&gt;
      &lt;/expense&gt;
  &lt;/account&gt;
  &lt;/Header&gt;
  </code></pre>
  
  <p>I need to display the result in an XML format as follows</p>
  
  <pre><code>&lt;Header&gt;
  &lt;id&gt; 1234 &lt;id&gt;
  &lt;type&gt; abcd &lt;type&gt;
  &lt;code1&gt;a11 &lt;/code1&gt;
  &lt;code2&gt;a12 &lt;/code2&gt;
  &lt;description&gt; Travel &lt;/description&gt;
  &lt;cost&gt; 40 &lt;/cost&gt; &lt;!-- sum of cost nodes, if description is Travel --&gt;
  &lt;description&gt; Hotel &lt;/description&gt;
  &lt;cost&gt; 30 &lt;/cost&gt; &lt;!-- sum of cost nodes, if description is Hotel --&gt;
  &lt;/Header&gt;
  </code></pre>
  
  <p>How do I write the sum of costs in XSLT 2.0 based on the condition?</p>