Unless you are forced to stick with XMLUnit 1.x I'd recommend you try 2.x instead. Do you configure XMLUnit to not compare unmatched elements? http://xmlunit.sourceforge.net/userguide/html/ar01s03.html#Comparison%20of%20Unmatched%20Elements
Many thanks, I really appreciate your addition to the user guide. Good luck with your NodeFilter, If it is useful outside of your specific use case then I'll be happy to accept it.
Harikesh, please don't comment on unrelated closed issues but create a new one if you think you've found a bug. In your case the NullPointerException probably stems from your comparator. Most likely there is a difference about an unmatched node (there is a text child node of secondChild in the control document but none in the test document). In the case of "missing nodes" one detail side of the Difference is null - which is the intended and documented behavior and so getTestNodeDetail() may be null...
I'm not sure what kind of update you exptected. The issue has been closed. I think we are only trying to figure out how to configure the difference engine to create the result you want it to produce, which is not a bug in XMLUnit. The comparison result you show doesn't match your example XML as it talks about Banana and your examples don't contain any Banana elements. In order to help you configuring XMLUnit correctly I'd need to know which result you would expect as correct in your case. If you...
this release fixes a bug in CompareMatcher that could throw a NoSuchElementException when combined with other hamcrest matchers. The full list of changes for XMLUnit for Java Made Travis build work with OpenJDK6 again. PR #101 by @PascalSchumacher. CompareMatcher's describeTo method threw an exception if the comparison yielded no differences. Issue #107.
XMLUnit for Java 2.5.1 Released
this release fixes a serious bug in the difference engine when documents only differ in namespace prefix. The full list of changes for XMLUnit.NET: elements that only differed in namespace prefix resulted in a false ELEMENT_TAG_NAME difference when compared. Issue #22
XMLUnit.NET 2.5.1 Released