XMLUnit extends JUnit and NUnit to enable unit testing of XML. It compares a control XML document to a test document or the result of a transformation, validates documents, and compares the results of XPath expressions.
The Java version is currently way more mature than the .NET version.