You may well wish to ignore more details when comparing:
Boundary whitespace
Child element order
Comments
Processing instructions