XML Loop

This task allows you to loop through data in a XML file.
An element needs to be specified. This element can be located at any level within the XML file node structure.
With every loop, the elements value and attribute names and values are set as variables.
If the element does not have a value, but has sub elements, then their names and values are set as variables.
With every loop, you can run another task.


Consider the following XML file:
(contacts)
(contact id="1")
(firstname)John(/firstname)
(lastname)Doe(/lastname)
(/contact)
(contact id="2")
(firstname)Jane(/firstname)
(lastname)Deer(/lastname)
(/contact)
(/contacts)

If element name field = contact, for each loop the following variables would be set:
AttributeName1=id , AttributeValue1=1 , SubElementName1 = firstname, SubElementValue1 = John etc..

If element name field = firstname, for each loop the following variables would be set:
ElementValue = John etc...