title: What is the best way to compare XML files for equality?
body: <p>I'm using .NET 2.0, and a recent code change has invalidated my previous Assert.AreEqual call (which compared two strings of XML).  Only one element of the XML is actually different in the new codebase, so my hope is that a comparison of all the other elements will give me the result I want.  The comparison needs to be done programmatically, since it's part of a unit test.</p>
  
  <p>At first, I was considering using a couple instances of XmlDocument.  But then I found this:
  <a href="http://drowningintechnicaldebt.com/blogs/scottroycraft/archive/2007/05/06/comparing-xml-files.aspx" rel="nofollow noreferrer">http://drowningintechnicaldebt.com/blogs/scottroycraft/archive/2007/05/06/comparing-xml-files.aspx</a></p>
  
  <p>It looks like it might work, but I was interested in Stack Overflow feedback in case there's a better way.</p>
  
  <p>I'd like to avoid adding another dependency for this if at all possible.</p>
  
  <h2>Similar questions</h2>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3552648/is-there-an-xml-asserts-for-nunit">Is there an XML asserts for NUnit?</a></li>
  <li><a href="https://stackoverflow.com/questions/167946/how-would-you-compare-two-xml-documents">How would you compare two XML Documents?</a></li>
  </ul>