Are these files small enough that both will fit in memory as DOMs?
I'm assuming that you want to ignore differences in formatting that a pure text comparison would find. For example - you want the two ways of writing an empty element to be considered identical.
<element></element> same as <element/>
A google search for "xml document equality" gets loads of hits since this problem has been bothering XML people for a long while.
Bill