If your input document is in standard XML format, all you have to know is the document structure( a DTD or a Schema model ). Once you have the model figured out, the rest is simple. Simply parse the incoming XML document( either as a file or as a stream ) and search for the nodes that is of interest to your application.
The key is to determine if the document you are going to receive has a standard and reliable structure. Rest is standard XML parsing. I suggest you first get the document model resolved. Once you get started, may be you can post specific queries if you get to a roadblock on the way.
Good luck,
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.