title: XmlUnit - how to ignore namespace prefix and compare 2 xml files?
body: <p>I have two xml files. First contains namespace prefix and the second one doesn't. So when I assert them I want to ignore these prefixes and check for equality.</p>
  <pre><code> @Test
      public void test1(){
          String control = &quot;&lt;prefix1:element xmlns:prefix1=\&quot;namespace\&quot; &gt;Some text&lt;/prefix1:element&gt;&quot;;
          String test = &quot;&lt;element xlmns=\&quot;namespace\&quot;&gt;Some text&lt;/element&gt;&quot;;
  
          XmlAssert.assertThat(controlElement).and(testElement)
                  .ignoreChildNodesOrder()
                  .ignoreComments()
                  .ignoreWhitespace()
                  .withNodeMatcher(new DefaultNodeMatcher((ElementSelector) (control,test)-&gt;
                  {
                  return control!=null &amp;&amp; test !=null &amp;&amp; Objects.equals(control.getLocalName(),test.getLocalName());
                  }
                  ))
                  .withDifferenceEvaluator((comparison,outcome)-&gt;{
                      System.out.println(comparison);
                      System.out.println(outcome);
                      if (outcome == ComparisonResult.EQUAL){
                          return outcome;
                      }
                      if (comparison.getType() == ComparisonType.NAMESPACE_URI
                      || comparison.getType()==ComparisonType.NAMESPACE_PREFIX){
                          System.out.println(&quot;aaaa&quot;);
                          return ComparisonResult.SIMILAR;
                      }
                      return outcome;
                  })
                  .areSimilar();
      }
  </code></pre>
  <p>So, this test is not passing and I get the following message:</p>
  <pre><code>java.lang.AssertionError: 
  Expecting:
   &lt;&lt;prefix1:element xmlns:prefix1=&quot;namespace&quot;&gt;Some text&lt;/prefix1:element&gt;&gt;
  to be equal to:
   &lt;&lt;element xlmns=&quot;namespace&quot;&gt;Some text&lt;/element&gt;&gt;
  but was not.
  </code></pre>
  <p>And what I need is that - this test case should be passing because all of the nodes and values are equal. Basically, a way to ignore the prefix</p>