Thanks for the reply, but I actually managed to find a solution using another of Dougs posts from a while ago utilising DocumentTreeFromXML (i was just focussed on the implimentation to update here):
set configFile to "C:\xml.config"
put file configFile into configXml
put DocumentTreeFromXML(configXml) into g_ConfigSource
set nodeQuery to "/appSettings/add[@key='" & key & "']"
put @value of node nodeQuery of g_ConfigSource into cfgValue
This is slightly out of context as i have this spread across 2 function calls and some parameterisation.
I also have to juggle the file content into the tree as the system does not seem to like dynamic path creation being used in the file access. The same can be said of the node query.
It is outside the scope of my use, but my XML is a unique key/value pair list so there are no duplicates. I don’t know if this approach would support a order / line item scenario where there are multiple nodes with the same key.