Best resource for basic XPath questions is this page: http://www.zvon.org/xxl/XPathTutorial/General/examples.html Second result in Google right after the XPath W3C page ;) And looking at http://www.zvon.org/xxl/ gives a whole lot more tutorials.