XMLUnit helps testing code that creates XML.

XMLUnit for Java is separated into three jars:

- `xmlunit-core` contains all algorithms and classes needed to validate XML, perform XPath queries or compare two pieces of XML.
- `xmlunit-matchers` contains Hamcrest matchers on top of `xmlunit-core`.
- `xmlunit-assertj` contains AssertJ assertions on top of `xmlunit-core`.

While XMLUnit is focussed on testing, parts of it may be useful in different contexts as well. The {@link org.xmlunit.diff.DifferenceEngine} may be the driver behind a visual XML diff tool for example.

The main use case of XMLUnit is comparing XML generated by the code under test with some known source of "good XML". This is the responsibility of the {@link org.xmlunit.diff.DifferenceEngine} and its main (currently sole) implementation {@link org.xmlunit.diff.DOMDifferenceEngine}.

Sometimes a full comparison is more than is needed in which case only parts of the generated document are validated using XPaths. This is the responsibility of {@link org.xmlunit.xpath.XPathEngine} and its implementation {@link org.xmlunit.xpath.JAXPXPathEngine}.

The validation package contains everything needed to validate documents against XML Schema (or even the schema document itself) or a DTD. Based of JAXP's validation package the {@link org.xmlunit.validation.JAXPValidator} class should be able to validate against different schema languages as well if you provided it with the needed implementations.

The builder package contains fluent builders that may provide an API that is more convenient to use in many cases.

A third jar `xmlunit-legacy` provides an API compatible to XMLUnit for Java 1.x that is implemented on top of XMLUnit Core.

XMLUnit for Java 2.6.0 adds a new experimental component `xmlunit-placeholders` that aims to provide a small DSL for configuring the test engine via the control XML document rather than code. The initial code base only supports a placeholder of `${xmlunit.ignore}` to be used in order to make XMLUnit ignore the element containing this sequence.

- XMLUnit's home page
- Source Code
- Contributing Guide
- Reporting Issues
- User Guide
- Developer Wiki

XMLUnit for Java is licensed under the Apache License, Version 2.0. The legacy jar uses the three clause BSD license, the same license as XMLUnit for Java 1.x did.