title: Compare XML ignoring element order
body: <p>With XMLUnit 2 how do you compare two documents without taking the element order into account?</p>
  
  <p>I got <a href="https://stackoverflow.com/questions/31057788/how-do-i-ignore-order-of-identical-elements-with-xmlunits-detaileddifference">this question for XMLUnit 1</a>, but apparently the new API in v2 doesn't have the mentioned method anymore.</p>
  
  <p>This is my current code:</p>
  
  <pre><code>Diff diff = DiffBuilder.compare(expected)
              .withTest(actual)
              .ignoreComments()
              .ignoreWhitespace()
              .checkForSimilar()
              .build();
  
  assertFalse(diff.hasDifferences());
  </code></pre>
  
  <p>Edit to Stefan Bodewigs comment:</p>
  
  <p>These are the two strings i compare with above snippet:</p>
  
  <pre><code>String expected = "&lt;root&gt;&lt;foo&gt;FOO&lt;/foo&gt;&lt;bar&gt;BAR&lt;/bar&gt;&lt;/root&gt;";
  String actual = "&lt;root&gt;&lt;bar&gt;BAR&lt;/bar&gt;&lt;foo&gt;FOO&lt;/foo&gt;&lt;/root&gt;";
  </code></pre>
  
  <p>The reported diffs</p>
  
  <pre><code>Expected element tag name 'foo' but was 'bar' - comparing &lt;foo...&gt; at /root[1]/foo[1] to &lt;bar...&gt; at /root[1]/bar[1] (DIFFERENT)
  Expected text value 'FOO' but was 'BAR' - comparing &lt;foo ...&gt;FOO&lt;/foo&gt; at /root[1]/foo[1]/text()[1] to &lt;bar ...&gt;BAR&lt;/bar&gt; at /root[1]/bar[1]/text()[1] (DIFFERENT)
  Expected element tag name 'bar' but was 'foo' - comparing &lt;bar...&gt; at /root[1]/bar[1] to &lt;foo...&gt; at /root[1]/foo[1] (DIFFERENT)
  Expected text value 'BAR' but was 'FOO' - comparing &lt;bar ...&gt;BAR&lt;/bar&gt; at /root[1]/bar[1]/text()[1] to &lt;foo ...&gt;FOO&lt;/foo&gt; at /root[1]/foo[1]/text()[1] (DIFFERENT)
  </code></pre>