Is there a possibility that we can compare two xml files and identify the differences in them. And then get the out put to a output new file.

I used diff xml1 xml2 but this gives me only differences in lines, what i am looking is for the differences from tree level.

  • what should be the diff output if 2 files have the same structure but different attribute value on some nested tag? May 8, 2017 at 8:14

1 Answer 1


diffxml is one tool that does this and xmldiff another. Both of them have options for choosing what you want to consider a difference, and produce structured output. With diffxml you get an XML file describing the necessary transformations in detail, and with xmldiff either a list of XSL selectors and what to do with them or an XML file in xupdate format.

There are also libraries for PHP, Perl, Perl again, Python, C#, ..., which you could use to build something giving whatever exact behaviour you wanted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .