# XML DOC from an Array

**URL:** https://forum.kirupa.com/t/xml-doc-from-an-array/43300
**Category:** flash
**Created:** [February 20, 2004, 8:43pm UTC](https://forum.kirupa.com/t/xml-doc-from-an-array/43300 "2004-02-20T20:43:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![scot](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@scot](https://forum.kirupa.com/u/scot)
#### Post date: [February 20, 2004, 8:43pm UTC](https://forum.kirupa.com/t/xml-doc-from-an-array/43300/1 "2004-02-20T20:43:19Z")

</div>

how can I create a XML docuement in ActionScript that looks like this

\<obj\>1st post  
\<obj\>reply to 1st\</obj\>  
\</obj\>  
\<obj\>2nd post\</obj\>  
\<obj\>3rd post  
\<obj\>reply to 3rd  
\<obj\>reply to 2nd of 3rd post\</obj\>  
\</obj\>  
\</obj\>  
\<obj\>4th post\</obj\>

from this array of data…

```auto

core = new Array();
core[0] = new Array(4);
core[0][0] = 1;
core[0][1] = 0;
core[0][2] = 1;
core[0][3] = "1st post";
core[1] = new Array(4);
core[1][0] = 2;
core[1][1] = 0;
core[1][2] = 2;
core[1][3] = "2nd post";
core[2] = new Array(4);
core[2][0] = 3;
core[2][1] = 0;
core[2][2] = 2;
core[2][3] = "3rd post";
core[3] = new Array(4);
core[3][0] = 4;
core[3][1] = 0;
core[3][2] = 2;
core[3][3] = "4th post";
core[4] = new Array(4);
core[4][0] = 5;
core[4][1] = 1;
core[4][2] = 1;
core[4][3] = "REPLY TO 1ST POST";
core[5] = new Array(4);
core[5][0] = 6;
core[5][1] = 3;
core[5][2] = 2;
core[5][3] = "REPLY TO 3RD POST";
core[6] = new Array(4);
core[6][0] = 7;
core[6][1] = 6;
core[6][2] = 2;
core[6][3] = "REPLY TO 2ND OF 3RD POST";

```

kind of at a lost trying to figure all the if() – for() etc… out
