PS. There's a great XML plugin for JEdit that will show you the results of an XPath search on your document. That way you can try out different variations until you get the result set that you want without having to run your script each time to test it.