XML & Web services: Comparing 2 XML Documents
Does anyone has any experience in comparing two XML documents and showing the diff between them.
maybe do a google search for java diff tool
If you just need to compare two XML files textually, try out ExamDiff. I guess the URL for ExamDiff is www.examdiff.com. If not, just google it out.
It would also be helpful to reduce the XML documents to some kind of "canonical form" before comparing them. You can use either XSLT or JAXP to do this.
I would suggest (a) stripping out all the whitespace-only nodes and (b) adding a line break after each end tag. That should cut down on false negatives because of whitespace differences.
You can take a look at http://xmlunit.sourceforge.net/ xml unit testing (like JUnit).