# XML Data to Object Properties Dynamically

**URL:** <https://forum.kirupa.com/t/xml-data-to-object-properties-dynamically/282265>\
**Category:** flash\
**Created:** [February 19, 2009, 2:46pm UTC](https://forum.kirupa.com/t/xml-data-to-object-properties-dynamically/282265 "2009-02-19T14:46:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![e\_owen](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@e\_owen](https://forum.kirupa.com/u/e_owen)\
**Post date:** [February 19, 2009, 2:46pm UTC](https://forum.kirupa.com/t/xml-data-to-object-properties-dynamically/282265/1 "2009-02-19T14:46:14Z")

</div>

When working with XML I find it best to bring in the XML document and then add the data to new objects so they can be easily referenced later. Previously I have done this by hard-coding the node names when I parse the XML and add the appropriate data to a property in my new custom object, allowing me to state what type of data it is, array, string, etc. I would really like a way to do this dynamically, so when I parse the XML it detects whether the node has children and makes an array, etc. Something was done by XML2Object in AS2.

Thanks,  
Elliot
