Well parsing XML is not an easy task.
Its basic structure is a tree with any node in tree capable of holding a container which consists of an array of more trees.
Each node in a tree contains a tag and a value but in addtion can contain an arbitary number of named attributes, and, an arbitary number of children or containers.
XML parsing tasks tend to fall in to three catagories.
Things that can be done with "regex". E.g. you want to find the value of the first "MailTo" tag and are not interested in the contents of any other tags.
Things you can parse yourself. The xml structure is always very simple e.g a root node and ten well known tags with simple values.
All the rest! Even though an xml message format can look deceptively simple home made parsers are easily confused by extra attributes, CDATA and unexpected children. Full blown XML parsers can handle all of these situations. Here the basic choice is between a stream or a DOM parser. If you intend to use most of the entities/attributes given in the order you want to use them then a DOM parser is ideal. If you are only interested in a few attributes and intend to use them in the order they are presented, if you have performance constraints, or, if the xml files are large ( > 500MB ) than a stream parser is the way to go; the callback mechanism takes a bit of "groking" but its actually quite simple to program once you get the hang of it.