Something like this might work for you:
deep-equal(doc($url1), doc($url2))
If you have specific rules about what makes two things equal you can write your own comparison function in XQuery.
Would you be able to provide a little more information about what you are trying to compare, and how the things to be compared are retrieved?
Vincent