Not quite. In case they come to their senses, here's some sample ASObjC code for doing an XPATH query. Results are returned as an XML object containing matching nodes, and a list of any matching attributes.
use framework "Foundation"
on extractFrom:thePath matchingXPath:theQuery
set aURL to current application's |NSURL|'s fileURLWithPath:thePath -- make NSURL
set theXMLDoc to current application's NSXMLDocument's alloc()'s initWithContentsOfURL:aURL options:0 |error|:(missing value) -- make XMLDoc
set attStrings to {} -- where attributes will be stored
set theXMLOutput to current application's NSXMLElement's alloc()'s initWithName:"output" -- found nodes added to this
set {theResults, theError} to (theXMLDoc's nodesForXPath:theQuery |error|:(reference)) -- query
if theResults is not missing value then
repeat with aNode in (theResults as list)
aNode's detach() -- need to detach first
if aNode's |kind|() as integer = current application's NSXMLAttributeKind then -- see if it's an attribute or node
set end of attStrings to (aNode's stringValue()) as text
else
(theXMLOutput's addChild:aNode) -- add node
end if
end repeat
return {(theXMLOutput's XMLStringWithOptions:(current application's NSXMLNodePrettyPrint)) as text, attStrings} -- change options to suit
else
return missing value
end if
end extractFrom:matchingXPath: