My XML looks like this:
3&
If you want to do this in a generic way then you are really stretching the capability of XSLT 1.0 beyond its design limits. But it can be done.
Write a named template called deep-equal that takes two elements as its arguments and returns a string containing the character "F" if and only if they are not equal (for your purposes).
It might look like this:
F
F
F
F
Apply this to all relevant pairs of elements:
Test if the result contains an "F":
...