# Creating XML

**URL:** <https://forum.kirupa.com/t/creating-xml/304689>\
**Category:** Uncategorized\
**Created:** [February 11, 2010, 10:27pm UTC](https://forum.kirupa.com/t/creating-xml/304689 "2010-02-11T22:27:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenBart](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@BenBart](https://forum.kirupa.com/u/BenBart)\
**Post date:** [February 11, 2010, 10:27pm UTC](https://forum.kirupa.com/t/creating-xml/304689/1 "2010-02-11T22:27:44Z")

</div>

I have no problem reading XML, but I want to create xml. Is there an easy way to created XML from an object?

For example:

```auto
var xml:XML = new XML("<images></images>");
XML.prettyPrinting = true;

var imageXML:XML = new XML('<image x="10"></image>');
xml.appendChild(imageXML);

trace(xml.toXMLString());

```

Could be something like this:

```auto
var xml:XML = new XML("<images></images>");
XML.prettyPrinting = true;

var image:Object = {x:11};
var imageXML:XML = new XML(image);
xml.appendChild(imageXML);

trace(xml.toXMLString());

```
