# Querying XML / Tree data

**URL:** <https://forums.eggplantsoftware.com/t/querying-xml-tree-data/8754>\
**Category:** Eggplant Functional\
**Tags:** data-driven, script, sensetalk, eggplant-functional\
**Created:** [February 27, 2024, 4:20pm UTC](https://forums.eggplantsoftware.com/t/querying-xml-tree-data/8754 "2024-02-27T16:20:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Paul](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@Paul](https://forums.eggplantsoftware.com/u/Paul)\
**Post date:** [February 29, 2024, 8:04pm UTC](https://forums.eggplantsoftware.com/t/querying-xml-tree-data/8754/3 "2024-02-29T20:04:43Z")

</div>

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):

```auto
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.

---

_[View the full topic](https://forums.eggplantsoftware.com/t/querying-xml-tree-data/8754)._
