# XML to object class - any xml tree

**URL:** <https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534>\
**Category:** open source\
**Created:** [April 14, 2006, 12:03am UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534 "2006-04-14T00:03:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [April 14, 2006, 12:03am UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534/1 "2006-04-14T00:03:38Z")

</div>

I’ve noticed tons of people writing xml parsers / load functions based specifically on each individual xml structure. A friend and I made this class that extends the XML class. You pass it your xml url and a callback method and it will convert any xml tree into an object where all nodes / attributes can be accessed via indices or object properties.

I’ve attached the class, an fla, and an xml sample so you can see how it all works. Hope you can find use of this.

---

<div class="post-metadata">

**Author:** ![bootiteq](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bootiteq](https://forum.kirupa.com/u/bootiteq)\
**Post date:** [April 14, 2006, 12:10am UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534/2 "2006-04-14T00:10:51Z")

</div>

Sounds great!  
Any chance of exporting a sample for mx2004?  
:sailor:

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [April 14, 2006, 12:18am UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534/3 "2006-04-14T00:18:55Z")

</div>

Sure - here is an MX sample:

---

<div class="post-metadata">

**Author:** ![bootiteq](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@bootiteq](https://forum.kirupa.com/u/bootiteq)\
**Post date:** [April 14, 2006, 12:49am UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534/4 "2006-04-14T00:49:10Z")

</div>

Creatify  
that rocks!

Nice work! :drool::thumb2:

---

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [April 16, 2006, 11:00am UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534/5 "2006-04-16T11:00:55Z")

</div>

I have been using a class from sephiroth.it for this purpose.  
check it out here: [http://www.sephiroth.it/index.php?blogId=2005\_03\_06\_weekly.html](http://www.sephiroth.it/index.php?blogId=2005_03_06_weekly.html)

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 16, 2006, 1:11pm UTC](https://forum.kirupa.com/t/xml-to-object-class-any-xml-tree/185534/6 "2006-04-16T13:11:45Z")

</div>

i made one that parses into an array ;/
