diff -w will work for nand2tetris.
For instance... is <keyword>class</keyword> compared to <keyword> class </keyword> the same thing?
To be overly picky, the XML specs say that whitespace in element data is significant.
The only purpose for writing the XML is for testing your parser. We don't insist that you write spec compliant XML 8^)
--Mark