title: Compare price in two XML files
body: <p>I don't know what would be the best way to compare price changes in two XML files.</p>
  
  <p>With XSLT I generate two (one actual, one older) XML from a price list:</p>
  
  <p>newer.xml:</p>
  
  <pre><code>&lt;xml&gt;
    &lt;produkt&gt;
      &lt;code&gt;000161&lt;/code&gt;
      &lt;name&gt;Test name&lt;/name&gt;
      &lt;available&gt;Yes&lt;/available&gt;
      &lt;price&gt;19,90&lt;/price&gt;
    &lt;/produkt&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>older.xml</p>
  
  <pre><code>&lt;xml&gt;
    &lt;produkt&gt;
      &lt;code&gt;000161&lt;/code&gt;
      &lt;name&gt;Test name&lt;/name&gt;
      &lt;available&gt;Yes&lt;/available&gt;
      &lt;price&gt;18,90&lt;/price&gt;
    &lt;/produkt&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>I tried to do a side by side comparison with a diff tool, but in the second XML are many new products so it's impossible.</p>
  
  <p>Perhaps it would be good to generate a new XML with XSLT, but it's beyond my knowledge.</p>
  
  <ul>
  <li>products are identified by <code>&lt;code&gt;</code></li>
  <li>check if product price changed, if yes copy element (and only in this case)</li>
  <li>don't check or copy new products (<code>&lt;code&gt;</code> does not exist in <code>older.xml</code>: do not copy)</li>
  </ul>
  
  <p>compare.xml</p>
  
  <pre><code>&lt;xml&gt;
    &lt;produkt&gt;
      &lt;code&gt;000161&lt;/code&gt;
      &lt;name&gt;Test name&lt;/name&gt;
      &lt;available&gt;Yes&lt;/available&gt;
      &lt;oldprice&gt;18,90&lt;/oldprice&gt;
      &lt;newprice&gt;19,90&lt;/newprice&gt;
    &lt;/produkt&gt;
  &lt;/xml&gt;
  </code></pre>