# Create xml from flash array

**URL:** https://forum.kirupa.com/t/create-xml-from-flash-array/238102
**Category:** flash
**Created:** [September 7, 2007, 7:44am UTC](https://forum.kirupa.com/t/create-xml-from-flash-array/238102 "2007-09-07T07:44:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![coop](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@coop](https://forum.kirupa.com/u/coop)
#### Post date: [September 7, 2007, 7:44am UTC](https://forum.kirupa.com/t/create-xml-from-flash-array/238102/1 "2007-09-07T07:44:24Z")

</div>

Hi all,

I have array that contains other arrays, and I need to create xml from this structure.

This is just an example of the osrt of array I have.

```auto

var cars = new Array();
var car1 = new Array()
var car2 = new Array()
var car3 = new Array()
car1.make = "ford"
car1.model = "capri"
car1.car_color = "red"
cars.push(car1)
car2.make = "citroen"
car2.model = "c2"
car2.car_color = "blue"
cars.push(car2)
car3.make = "audi"
car3.model = "coupe"
car3.car_color = "black"
cars.push(car3)
trace(cars[0].make)

```

and this is the sort of xml I was tring to get from it.

```auto

<cars>
        <car1>
           <make>ford</make>
           <model>capri</model>
           <color>red</color>
        <car1>
        <car2>
           <make>citroen</make>
           <model>c2</model>
           <color>blue</color>
        </car2>
        …

</cars>

```
