# Loading XML into List component

**URL:** <https://forum.kirupa.com/t/loading-xml-into-list-component/305581>\
**Category:** Uncategorized\
**Created:** [February 27, 2010, 9:19pm UTC](https://forum.kirupa.com/t/loading-xml-into-list-component/305581 "2010-02-27T21:19:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamrobot](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@jamrobot](https://forum.kirupa.com/u/jamrobot)\
**Post date:** [February 27, 2010, 9:19pm UTC](https://forum.kirupa.com/t/loading-xml-into-list-component/305581/1 "2010-02-27T21:19:08Z")

</div>

I want to load all of the xml (a list of events and their date and name)… So far i’ve got…

home.fla

```php
stop();

var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

xmlLoader.load(new URLRequest("news.xml"));

function LoadXML(e:Event):void {
    xmlData=new XML(e.target.data);
    ParseNews(xmlData);
}

function ParseNews(newsXML:XML):void {
    
    var newsList:XMLList=newsXML.item.children();
    
    for each (var newsTitle:XML in newsList) {
    my_lst.addItem({label:newsTitle});
    }
}

```

news.xml

```php
<?xml version="1.0" encoding="iso-8859-1"?> 
<news>

<item date="02/02/2007">
  <title>news2</title> 
  <description>Lorem ipsum elitrgh dolor sit amet, consectetuer adipiscing elit. Maecenas vitae nisi.</description> 
  <pic>japao2</pic> 
  </item>
<item date="03/03/2007">
  <title>news3</title> 
  <description>Lorem ipsum elitrgh dolor sit amet, consectetuer adipiscing elit. Maecenas vitae nisi.</description> 
  <pic>japao3</pic> 
  </item>
<item date="04/04/2007">
  <title>news4</title> 
  <description>Lorem ipsum elitrgh dolor sit amet, consectetuer adipiscing elit. Maecenas vitae nisi.</description> 
  <pic>japao4</pic> 
  </item>
</news>

```

is there any way to make sure the text is wrapped inside the list, as right now, the description doesn’t all show inside the list…

also is there any way to make it load a picture?? in any case, is it best to use a list or is there a more efficient way to do all this???
