Have a look at File comparison tools, from which I am using WinMerge. It has an ability to compare XML documents (you may wish to enable DisplayXMLFiles prefilter for v2.14.0 or PrettifyXML for v2.16.x).

DisplayXMLFiles.dll - This plugin pretty-prints XML files nicely by inserting tabs and line breaks. This is useful for XML files that do not have line returns in convenient locations.

Note for v2.16.x

The plugin PrettifyXML is supplied with the software package. It can be activated as following:

  • Make sure that Plugins β†’ Plugin Settings β†’ Enable plugins is enabled.
  • Then use either File β†’ Recompare As β†’ Prettify XML or Plugins β†’ Scripts β†’ Prettify XML

For those who wish to play with deprecated DisplayXMLFiles, he needs to download e.g. winmerge-2.16.14-full-src.7z and copy Plugins\dlls\X64\DisplayXMLFiles.dll to WinMerge\MergePlugins\.

See also my feature comparison table.

Answer from dma_k on Stack Overflow
🌐
CoreFiling
corefiling.com β€Ί home β€Ί open source tools β€Ί xml comparison tool
Free Online XML Comparison Tool
June 20, 2025 - CoreFiling XML Differences uses XML Pretty Printer and a custom diff to display differences between XML files in an easy-to-read format. We hope you find this tool useful – please remember not to use online tools with production data!
🌐
Altova
altova.com β€Ί xmlspy-xml-editor β€Ί compare-xml
Compare XML Files | Altova
If you don't need a complete XML ... other source code files, you can choose DiffDog for file, directory, and database comparisons. DiffDog also supports XML-aware comparisons, including graphical XML Schema differencing and will automatically generate an XSLT stylesheet to transform XML documents to the new XSD. You can download a free trial of DiffDog, or test drive the MissionKit tool suite, which ...
Top answer
1 of 11
36

Have a look at File comparison tools, from which I am using WinMerge. It has an ability to compare XML documents (you may wish to enable DisplayXMLFiles prefilter for v2.14.0 or PrettifyXML for v2.16.x).

DisplayXMLFiles.dll - This plugin pretty-prints XML files nicely by inserting tabs and line breaks. This is useful for XML files that do not have line returns in convenient locations.

Note for v2.16.x

The plugin PrettifyXML is supplied with the software package. It can be activated as following:

  • Make sure that Plugins β†’ Plugin Settings β†’ Enable plugins is enabled.
  • Then use either File β†’ Recompare As β†’ Prettify XML or Plugins β†’ Scripts β†’ Prettify XML

For those who wish to play with deprecated DisplayXMLFiles, he needs to download e.g. winmerge-2.16.14-full-src.7z and copy Plugins\dlls\X64\DisplayXMLFiles.dll to WinMerge\MergePlugins\.

See also my feature comparison table.

2 of 11
22

I wrote and released a Windows application that specifically solves the problem of comparing and merging XML files.

Project: Merge can perform two and three way comparisons and merges of any XML file (where two of the files are considered to be independent revisions of a common base file). You can instruct it to identify elements within the input files by attribute values, or the content of child elements, among other things.

It is fully controllable via the command line and can also generate text reports containing the differences between the files.

🌐
SourceForge
diffxml.sourceforge.net
diffxml - XML Diff and Patch Utilities
diffxml & patchxml: Tools for comparing and patching XML files Β· The standard Unix tools diff and patch are used to find the differences between text files and to apply the differences. These tools operate on a line by line basis using well-studied methods for computing the longest common ...
🌐
GitHub
github.com β€Ί Shoobx β€Ί xmldiff
GitHub - Shoobx/xmldiff: A library and command line utility for diffing xml
A library and command line utility for diffing xml - Shoobx/xmldiff
Starred by 226 users
Forked by 53 users
Languages Β  Python 98.7% | Python 98.7%
Top answer
1 of 6
9

Technically, XMLs are different

  • if they have whitespaces or not
  • if the order is different
  • if they have comments or not
  • if they have processing instructions or not
  • if their encoding is different
  • if their namespaces are different

but of course you can decide to ignore that or not, based on the semantic information an XML does not have.

Microsoft has developed the XML Diff and Patch tool for this purpose and you can integrate it in your own applications.

Note: the tool installs as "SQLXML Bulkload in .NET Code Sample" and comes with a Visual Studio solution XmlDiffView.sln that you need to compile yourself. Some basic programming knowledge in C# and Visual Studio Community Edition should be ok.

However, as mentioned in one of the answers on Stack Overflow, it has been compiled and made available on Bitbucket.

After that it comes with a UI that let's you choose the various XML comparison options:

When I apply it to the 2 XMLs of your questions, it throws an exception. That is because of the namespaces which are not defined. After removing the namespaces, it says:

2 of 6
6

Focusing on the part that moved sections should be reported as no difference made me think of https://semanticmerge.com/, which doesn't compare XML-files, but C# and C code. And as it understand those languages it is able to display if code has moved and not changed.

This leads to an alternative approach for this question: Could it be possible to translate the XML into C# classes, and then do a semantic merge on the resulting code?

One possible approach, if this tool is not written already, could be to translate each and every element to classes, and each attribute (and body texts) to a string property within that class. If you want to ignore namespaces, then let your translator remove them in the translation process.

I translated the XML example given as proof of concept and got the following:

class soapenv__Body {
  class mes__GetItem {
    class mes__ItemShape {
      class typ__BaseShape {
          string body="IdOnly";
      }
      class typ__BodyType {
          string body="Textus";
      }
      class typ__AdditionalProperties {
        class typ__FieldURI  {
            string FieldURI="item:Subject";
        }
        class typ__FieldURI  {
            string FieldURI="item:Categories"; 
        }
      }
    }
    class mes__ItemIds {
      class typ__ItemId {
          string Id="AAMYAAA=";
      }
    }
  }
}

Then I switched the mes:ItemIds and mes:ItemShape and changed the text to Textus. Compared the following two files in Semantic Merge and got the following image:

In this image one can see the move, indicated by the M icon, and the change in text indicated by the C icon. Lines indicates where the different parts have moved/changed, and it possible to actually see the differences if they exist.

Note that Semantic Merge even though understanding C# code, isn't to strict on the identical class names of typ__FieldURI, which could be a nice features as XML can contain multiple nodes with the same name.

Summa summarum: Semantic Merge can correctly identify the XML as identical (or not) even though elements move, if you can convert the XML into a C# class structure.

🌐
GitHub
github.com β€Ί vkononov β€Ί compare-xml
GitHub - vkononov/compare-xml: CompareXML is a fast, lightweight and feature-rich tool that will solve your XML/HTML comparison or diffing needs. its purpose is to compare two instances of Nokogiri::XML::Node or Nokogiri::XML::NodeSet for equality or equivalency.
This gem was inspired by Michael B. Klein's gem equivalent-xml - another excellent tool for XML comparison. The gem is available as open source under the terms of the MIT License.
Starred by 13 users
Forked by 3 users
Languages Β  Ruby 58.1% | HTML 41.6% | Shell 0.3% | Ruby 58.1% | HTML 41.6% | Shell 0.3%
Find elsewhere
🌐
SemanticDiff
semanticdiff.com β€Ί online-diff β€Ί xml
SemanticDiff - Compare XML Online
Install for VS Code Use with GitHub Our VS Code extension is also available via Open VSX. ... Please check the marked area for syntax errors and verify that the correct language is selected. ... Use our free online XML diff to perform a semantic comparison between two XML documents.
🌐
GitHub
github.com β€Ί lukasz-kusek β€Ί xml-comparator
GitHub - lukasz-kusek/xml-comparator: XML comparing tool provides an utility for XML documents comparison.
XML comparing tool provides an utility for XML documents comparison. - lukasz-kusek/xml-comparator
Starred by 9 users
Forked by 8 users
Languages Β  Java 98.2% | XSLT 1.8% | Java 98.2% | XSLT 1.8%
🌐
GitHub
github.com β€Ί joh β€Ί xmldiffs
GitHub - joh/xmldiffs: Compare two XML files, ignoring element and attribute order.
Compare two XML files, ignoring element and attribute order. - joh/xmldiffs
Starred by 96 users
Forked by 27 users
Languages Β  Python 100.0% | Python 100.0%
🌐
Xlcompare
xlcompare.com β€Ί compare-xml-files.html
Compare XML Files Online. Free. No Upload. Get the Semantic XML diffs.
October 3, 2009 - Compare two XML docs and get the difference online. Drop your files on this page and get the highlighted diffs. Get semantic XML differences by comparing XML documents with key nodes and attributes.
🌐
Ali-ulvi
ali-ulvi.github.io β€Ί XML_equality_checker_comparer.html
XML Compare Test Tool
Sometimes we need to compare XML files ignoring their elements' order but there was not such FREE tool before. Now there is!
Top answer
1 of 3
4

To summarise, addressing your requirements:

  1. Comparison tool that can compare XSD files: Yes
  2. Can identify changes in structure, not just content of XSD files: Yes
  3. Can ignore expected changes: Yes
  4. Orderless comparisons; avoiding false positives from moved elements: Yes
  5. Compare all files at once: Yes, through batch processing
  6. Produce a report with the details: Unclear what is needed here

XML Compare, developed by DeltaXML, is a structurally aware XML comparison tool that is able to identify change in both the structure and the content of XML files, including XSD.

In instances where elements have moved in the file but the order of said elements is not significant to the comparison, XML Compare has built in functionality for Comparing Orderless Elements. This can be customised extensively using XSLT as needed.

When you are expecting changes that do not need to be identified as change, you can use XML Compare's built in Ignoring Changes functionality which can again be customised using XSLT.

For bulk processing of your files, although XML Compare only compares files 1-to-1, it can be run via the command line, REST API and Java API. This means that by writing a batch file to queue up comparison operations, or if you use the REST API the comparison operations will be queued automatically.

Finally, to address your need for a report summarising the results, this depends on what you mean. XML Compare is capable of producing HTML reports from diff outputs that highlight changes in-line or side-by-side. It sounds however like you may be looking for a more statistical report on the results of the comparisons, for which XML Compare does not currently have a facility. It is worth noting however that the diff outputs produced by XML Compare are valid XML, and can be readily processed to identify the change attributes in the file.

Disclosure: I am an employee of DeltaXML.

2 of 3
2

That's quite a challenge, because so many differences are possible: you may have to make compromises depending on what you actually encounter. (For example, you may or may not need to bother with named model groups, depending on whether either of the schemas you are comparing actually uses them. Most schemas don't.)

If I were doing this (and of course I'm biased towards using my own tools) I would start by using Saxon's schema validator to generate SCM (schema component model) files for both schemas. This will do a fair bit of normalization, e.g. handling the difference between inline types and references to named global types. I would then write an XSLT stylesheet to do further normalization on the SCM files, for example sorting components into a canonical order, sorting enumeration values, and so on; also, eliminating the parts of the SCM files that aren't relevant, such as finite state machine details. I would then probably write a custom XSLT comparison module to compare the two normalized SCM files (along the lines of https://dvcs.w3.org/hg/xslt30-test/file/tip/runner/compare.xsl which is used for comparing XSLT test results) - the key being that you don't just want a boolean answer saying whether they are the same or different, you want to highlight the differences. Alternatively you could use fn:deep-equal to test whether they are the same, and then using a visual diff tool to examine them side-by-side if not.

🌐
Reddit
reddit.com β€Ί r/xml β€Ί xml comparison tool
r/xml on Reddit: XML comparison tool
May 23, 2025 -

Is there a tool that will compare two XML files to see if they match? A search found tools that appear to do text comparisons and have the ability to pretty-print the files being compared. I don't want that. I want to know that the two files contain the same elements, that each element contains the same subelements, that each element contains the same attributes, and that each attribute contains the same values.

🌐
ExtendsClass
extendsclass.com β€Ί xml-diff.html
XML diff - Compare xml online
This small tool allows to compare two XML data structures, and visualize the diff. Copy and paste, drag and drop a XML file or directly type in the editors above, and then click on "Compare" button they will be compared if the two XML are valids. You can also click on "load XML from URL" button to load your XML data from a URL (Must be https).
🌐
Oxygen XML
oxygenxml.com β€Ί xml_diff_and_merge.html
Oxygen Compare and Merge Tools
Oxygen provides a simple means of performing file and folder comparisons. The complete XML diff and merge solution offers directory, file, 3-way, and XML fragment comparisons, six different algorithms, and multiple levels of comparison.
🌐
AlternativeTo
alternativeto.net β€Ί software β€Ί softwium-xml-compare
Softwium XML Compare Alternatives: Top 5 Diff Tools & Similar Websites | AlternativeTo
Diffchecker is Paid and ProprietarySoftwium XML Compare is Free and Proprietary ... Last commit in 2017. ... Compare is the most popular Open Source & free alternative to Softwium XML Compare.
🌐
Altova
altova.com β€Ί diffdog
DiffDog Diff/Merge Tool | Altova
Altova DiffDog is the unique XML-aware diff / merge tool that lets you compare and merge text or source code files, XML or JSON files, and Word documents. Compare and synchronize directories, database schemas and content, and much more. ... With a straightforward and consistent user interface, ...