You are not going to be able to use XML tools if you don't have an XML document. So either:
1. repair the ill-formatted document
-or-
2. write your own code to extract the elements/text you want to compare by normal
Java String methods.
Your description of the problem seems to have changed - do you really want to
test for equality of two documents or are you just checking for identity of one small data item?
Bill