I am looking for a way to loop through an XML-Body and pass each xml element into a struct. i got access to the xml body in this way:
unless you know the structure of the XML object ahead of time you will have to test each child object and traverse down the nodes till you know you have a simple object. To help there are the "is" functions as in:
isObject(var);
isStruct(var);
isArray(var);
isSimpleValue(variable);
Once you know you have an array (for example) you loop through it's index by length as in:
.... more looping...
This can be pretty daunting for really complex objects. I'm curious as to why you would do it? XML is designed to be "non-flat" - is there a specific requirement to flatten it?