title: How to check for changes in a XML file?
body: <p>I want to make sure 2 XML files are the same, and the 2 options I see are.
   1. Get the XML to have a last modification date with time, and check that is the same. Problem is that someone may forget to change it and then it is useless.
   2. Create a hashcode of the xml file/structure. </p>
  
  <p>I use a build in library in java, but the hash implementation can change from run to run which is not helpful </p>
  
  <pre><code>File model = new File(fileLocation);
  DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
  DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
  Document doc = dBuilder.parse(model);
  doc.getHash();
  </code></pre>
  
  <p>is there an easy way to do this, and hopefully without importing another library.</p>