title: Is there any formal way or known way to canonicalize an xml file to generate diffs?
body: <p>There seems to be many questions WRT tool to generate diffs between xmls, but there wasn't this question yet, so anyone who knows this show me a link or paste any example anyone already solved this problem.</p>
  
  <p>Canonicalizing an xml file means,</p>
  
  <ul>
  <li>reordering the appearance of attributes</li>
  <li>reordering the appearance of tags (selectable by command line option)</li>
  <li>insert line ending(CR/CR+LF/LF) if there isn't at the end of a close tag</li>
  <li>insert indentation tab(space)</li>
  <li>remove redundant spaces and line endings</li>
  </ul>
  
  <p>And then you can cleanly diff the xml files to see which part was updated.</p>
  
  <p>I want to use the routine to canonicalize in unix environment, as quick as possible, before checking in to version control repository.</p>