kenhans 0 Newbie Poster

I have an XML that looks something like this. It contains Subscriptions with some attributes. There are about 50 attributes to one subscription (only 3 listed here) and I'm trying to find out if there is a difference between one of the <cell>-elements in <values> and <oldValues>. If there is a difference, the subscription is supposed to be marked as "changed".

Is there a smart way I can use XPath to accomplish this? My first though was to populate a java-object containing all the <values> and <oldValues> and then compare one after another to see if there is a difference. It sounds too brute, though, and I was hoping for a more elegant solution.

any suggestions would be highly appreciated.

<?xml version="1.0" encoding="UTF-8"?>
<tran eventId="102">
    <update schema="Subscription">
        <values>
            <cell name="subscr_id" type="NUMERIC">321</cell>
            <cell name="contract_id" type="INT">12</cell>
            <cell name="subscr_version_id" type="SMALLINT">1</cell>
	    <cell....
        </values>
        <oldValues>
            <cell name="subscr_id" type="NUMERIC">321</cell>
            <cell name="contract_id" type="INT">12</cell>
            <cell name="subscr_version_id" type="SMALLINT">2</cell>			
	    <cell....
        </oldValues>
    </update>
</tran>