The question is slightly old, but I couldn't resist the prospects of a good discussion!
Assume the following trivial XML fragments:
With ns1 and ns2 both referring to the same namespace.
We can both tell that the first XML fragment is a valid version of the second XML fragment that has not been tampered with.
However, in order for a piece of software to be able to determine this, I feel we need to transform the XML fragments into some kind of normalized (i.e. canonical) form.
Having been "normalized", the program will then be able to determine if the XML fragments are equal or not.