title: Java: Easiest way to compare two xmls
body: <p>I have two xmls:</p>
  
  <pre><code>first.xml
  
  &lt;text&gt;This is text&lt;/text&gt;
  &lt;output&gt;This is output&lt;/output&gt;
  
  second.xml
  
  &lt;text&gt;This is not text&lt;/text&gt;
  &lt;output&gt;This is output&lt;/output&gt;
  </code></pre>
  
  <p>I want to compare these two xmls and output should like this</p>
  
  <pre><code>&lt;text&gt;This is &lt;inserted&gt;not&lt;/inserted&gt; text&lt;/text&gt;
      &lt;output&gt;This is output&lt;/output&gt;
  </code></pre>
  
  <p>Means, I want to add a new tag suppose <code>&lt;inserted&gt;</code> to newly added text.
  How to compare these xmls and create new one ?</p>
  
  <p>Thanks for ur time :)</p>