Add_Bddd
(Add Bddd)
1
Hello,
Let say my XML is that structured
<main>
<position>
<id>
<name>
<position>
<id>
<name>
<position>
<id>
<name>
</main>
What i want to get is loop through every positio> and every id/name
I tried something like that:
So i wanted loop through positions and than every node in it, but it is not working 
Hi @Add_Bddd ,
- Use UiPath.WebAPI.Activities
- Deserialize the string using “Deserialize XML” activity and get the output in a variable “varXMLData”
To get all the elements use below code
varXMLData.Root.Elements
To get specific node use below code
varXMLData.Root.Elements("position")
Add_Bddd
(Add Bddd)
3
I had to use “node.Descendants” in second loop instead of node.Nodes. Now it`s working 
ppr
(Peter Preuss)
4
xDoc.Root.Elements(“position”) used for the loop
1 Like
Add_Bddd
(Add Bddd)
5
Thank you @ppr, however i do not have that option ( community version uipath )

ppr
(Peter Preuss)
6
you do have. Just show us what you have done so far and what is not working
Add_Bddd
(Add Bddd)
7
It is working now, i have just changed node.Nodes to node.Descendants (from 1 post screenshot)
First loop :
For each node in document.Element(“main”).Elements(“positions”)
Second loop:
For each item in node.Descendats
Now it is looping through every position element and every one inside it.
Was just curious about yours method, however i do not have “Values” field in For Each properties
ppr
(Peter Preuss)
8
check your imports for following namespaces:


List of Items is just a renaming of Values when working with a newer version of the package