code: public static DifferenceEvaluator ignorePrologDifferences() {
          return new DifferenceEvaluator() {
              @Override
              public ComparisonResult evaluate(Comparison comparison, ComparisonResult orig) {
                  return belongsToProlog(comparison, true)
                      || isSequenceOfRootElement(comparison)
                      ? ComparisonResult.EQUAL : orig;
              }
          };
      }
docs: Ignore any differences that are part of the <a
  href="https://www.w3.org/TR/2008/REC-xml-20081126/#sec-prolog-dtd">XML
  prolog</a>.
  
  <p>Here "ignore" means return {@code ComparisonResult.EQUAL}.</p>
  
  @since XMLUnit 2.1.0