title: XSLT 1.0 - Sum column based on conditions from 2 nodes
body: <p>I have 2 data sources (Request and Actual). Below is a sample of my xml:</p>
  
  <pre><code>&lt;dsQuery Response&gt;
    &lt;Request&gt;
      &lt;Rows&gt;
        &lt;Row&gt;
          &lt;TravelDate&gt;2013-10-05T05:00:00Z&lt;/TravelDate&gt;
          &lt;ID&gt;1&lt;/ID&gt;
         &lt;Cost&gt;1000&lt;/Cost&gt;
       &lt;/Row&gt;
       &lt;Row&gt;
          &lt;TravelDate&gt;2013-12-31T05:00:00Z&lt;/TravelDate&gt;
          &lt;ID&gt;2&lt;/ID
          &lt;Cost&gt;2500&lt;/Cost&gt;
       &lt;/Row&gt;
       &lt;Row&gt;
        &lt;TravelDate&gt;2014-01-13T06:00:00Z&lt;/TravelDate&gt;
        &lt;ID&gt;3&lt;/ID&gt;
        &lt;Cost&gt;1300&lt;/Cost&gt;
       &lt;/Row&gt;
     &lt;Row&gt;
        &lt;TravelDate&gt;2014-02-01T06:00:00Z&lt;/TravelDate&gt;
        &lt;ID&gt;4&lt;/ID&gt;
        &lt;Cost&gt;2300&lt;/Cost&gt;
      &lt;/Row&gt;
      &lt;Row&gt;
        &lt;TravelDate&gt;2014-08-01T06:00:00Z&lt;/TravelDate&gt;
        &lt;ID&gt;5&lt;/ID&gt;
        &lt;Cost&gt;2000&lt;/Cost&gt;
      &lt;/Row&gt;
      &lt;/Rows&gt;
    &lt;/Request&gt;
    &lt;Actual&gt;
      &lt;Rows&gt;
        &lt;Row&gt;
          &lt;ID&gt;10&lt;/ID&gt;
          &lt;FormID&gt;2&lt;/FormID&gt;
          &lt;CheckDate&gt;2014-01-01T12:00:00Z&lt;/CheckDate&gt;
        &lt;/Row&gt;
        &lt;Row&gt;
          &lt;ID&gt;11&lt;/ID&gt;
          &lt;FormID&gt;3&lt;/FormID&gt;
          &lt;CheckDate&gt;2014-01-31T12:00:00Z&lt;/CheckDate&gt;
      &lt;/Row&gt;
      &lt;Row&gt;
        &lt;ID&gt;12&lt;/ID&gt;
        &lt;FormID&gt;4&lt;/FormID&gt;
        &lt;CheckDate&gt;2014-02-15T12:00:00Z&lt;/CheckDate&gt;
      &lt;/Row&gt;
    &lt;/Rows&gt;
  &lt;/Actual&gt;
  &lt;/dsQuery Response&gt;
  </code></pre>
  
  <p>I need to sum the Cost column if the year for TravelDate=This year OR if the year of the CheckDate = This Year.</p>
  
  <p>In the scenario above Request ID 2-5 meet the criteria.  The total should be 8100.  I have tried several ways to get the sum and none are working.  Any help is appreciated.</p>