Parsing an XML Document with XPath (16 tags)
Pulling just a single node value or attribute from an XML document can be inefficient if you have to parse over a whole list of nodes you don't want, just to get to one you do. XPath can be much more efficient, by letting you specify the path to the desired node up front. J2SE adds XPath support, and the JDOM API also offers support through an XPath class. Deepak Vohra looks at both approaches.