# CSV value in XML file

**URL:** https://forum.kirupa.com/t/csv-value-in-xml-file/317598
**Category:** flash
**Created:** [December 27, 2010, 12:48am UTC](https://forum.kirupa.com/t/csv-value-in-xml-file/317598 "2010-12-27T00:48:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tolgainam](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tolgainam](https://forum.kirupa.com/u/tolgainam)
#### Post date: [December 27, 2010, 12:48am UTC](https://forum.kirupa.com/t/csv-value-in-xml-file/317598/1 "2010-12-27T00:48:31Z")

</div>

Hello ,  
I am trying to prepare a CSV file like stuff in a XML file that will have a structure like the foloowing code below:

\<levels\>

\<level\>  
\<name\>LEVEL 1\</name\>  
\<tiles\>  
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,  
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,  
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,  
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  
\</level\>

\<level\>  
\</level\>

\<level\>  
\</level\>

\</levels\>

…

I was doing this system inside the AS files until today and creating Arrays  
but now I need to do it in a XML file.

what I want to know is, how should the XML file need to be  
and how can I read it ?

```php

var xmlLoader:URLLoader = new URLLoader();
var url:URLRequest = new URLRequest("levels.xml");
xmlLoader.load(url);
xmlLoader.addEventListener(Event.COMPLETE, onXmlLoad);

function onXmlLoad(e:Event):void {
    trace("xml loaded");
var xml = new XML(xmlLoader.data);
var productElements:XMLList = xml.level;
 trace(productElements[1].length());
}

```

does not work as I cant reach the 1 and 0 seperataly.

Thanks for all the help.
