title: Merging XML file changes in git
body: <p>When merging one git branch into another, a common source of merge conflicts is on one of my XML files, where new (but different) XML has been added at the same insertion point of the file on both branches. In my case, I want git to automatically include the newly inserted XML from both branches in the merged result, and I don't care which branch's changes gets inserted above the other.</p>
  
  <p>Is it possible to configure git to do this?</p>
  
  <p>Edit: I have found that I can put the line:</p>
  
  <pre><code>*.xml   merge=union
  </code></pre>
  
  <p>Into the .gitattributes file - but this isn't working quite the way I would want.</p>
  
  <p>Say on my working branch, this XML has been added:</p>
  
  <pre><code>&lt;itemlist id="1"&gt;
     &lt;item id="1"&gt;&lt;/item&gt;
  &lt;/itemlist&gt;
  </code></pre>
  
  <p>And then on the branch that I intend to merge into mine, this has been added - at exactly the same location:</p>
  
  <pre><code>&lt;itemlist id="2"&gt;
     &lt;item id="2"&gt;&lt;/item&gt;
  &lt;/itemlist&gt;
  </code></pre>
  
  <p>Then, git notices that both sets of changes end in the same text (i.e. the line with the end tag on). It seems to think that because both sides have added the same text, it shouldn't duplicate that text in the merge, so it only ends up inserting the following during the merge:</p>
  
  <pre><code>&lt;itemlist id="2"&gt;
     &lt;item id="2"&gt;&lt;/item&gt;
  </code></pre>
  
  <p>Which of course results in invalid XML.</p>
  
  <p>Is there further configuration I can do to switch off this "only-merge-changes-that-are-not-also-changes-in-the-working-branch" option?</p>