I'm having a very difficult time with XML.

I have a list of purchases.
I also have a list of payments.

How would I compare the total purchases to the total payemnts and pop up a message if they weren't equal?

It sounds simple, but I've tried many different ways with no luck. Any ideas/examples would be very appreciated.