# Creating dynamic xml

**URL:** <https://forum.kirupa.com/t/creating-dynamic-xml/254455>\
**Category:** Uncategorized\
**Created:** [March 12, 2008, 11:03am UTC](https://forum.kirupa.com/t/creating-dynamic-xml/254455 "2008-03-12T11:03:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoolagon](https://avatars.discourse-cdn.com/v4/letter/h/58956e/32.png) [@hoolagon](https://forum.kirupa.com/u/hoolagon)\
**Post date:** [March 12, 2008, 11:03am UTC](https://forum.kirupa.com/t/creating-dynamic-xml/254455/1 "2008-03-12T11:03:00Z")

</div>

The help files give an example like this to convert a sting to xml

```php
var xml:XML =
        <p>hello</p>;
trace(xml); // hello
trace(xml.toXMLString()); // <p>hello</p>

```

However I need it to be dynamic and more like this:

```php

var newXml:XML =
for (var i:int=0;i<oldXmlList.length(); i++) {
           <books id=" + oldXmlList*.@id + " value=" + sliderValues*.value + " />")
   
}

```

Im obviously doing something wrong. Does anyone knoe the correct methods and syntax I need to use here?
