What is an alternative to this XPath //div[@id=\'foo\'] in GPath? In general, where I can find this documentation?
//div[@id=\'foo\']
The previous poster gave you all that's required: Assuming your document has been slurped into xml, you want
xml
def foo = xml.path.to.div.find{it.@id == 'foo'}
to find a single result. Or findAll to find all results.
findAll