OK, that is interesting, thanks. I didn’t think it could be done in one XPath query like that.
So:
set theDoc to current application's NSXMLDocument's alloc()'s initWithXMLString:pxml options:0 |error|:(missing value)
set {theNodes, theError} to theDoc's nodesForXPath:"//key['MacroActionType'=text()]/following-sibling::string['ExecuteAppleScript'=text()]/following-sibling::key['Path'=text()]/following-sibling::string[1]" |error|:(reference)
return (theNodes's valueForKey:"stringValue") as list --> {"", "%Variable%DND__KM_Scripts_Folder%/Test 2 AppleScript File.scpt"}