# Replacement of loadxml.as file in AS3

**URL:** <https://forum.kirupa.com/t/replacement-of-loadxml-as-file-in-as3/312761>\
**Category:** Uncategorized\
**Created:** [August 12, 2010, 4:12am UTC](https://forum.kirupa.com/t/replacement-of-loadxml-as-file-in-as3/312761 "2010-08-12T04:12:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitinmukesh](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@nitinmukesh](https://forum.kirupa.com/u/nitinmukesh)\
**Post date:** [August 12, 2010, 4:12am UTC](https://forum.kirupa.com/t/replacement-of-loadxml-as-file-in-as3/312761/1 "2010-08-12T04:12:31Z")

</div>

Hi,

I have used loadXMl.as file for XML to Object conversion till date. I am now converting the framework from AS1 to AS3.

Is there any alternate in AS3 for XML to Object conversion other than using the XML class. I am facing a lot of problems with XML class which I am not used to.

Here is the example

XML file

```php

<?xml version="1.0" encoding="UTF-8"?>
<globalconfig>
    <default_language><![CDATA[English]]></default_language>
    <default_language_flag><![CDATA[en_gb]]></default_language_flag>
</globalconfig>

```

AS code

```php
var xmlLoader:URLLoader = new URLLoader();
var configXML:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadConfigXML, false, 0, true);
xmlLoader.load(new URLRequest("config.xml"));
function LoadConfigXML(e:Event):void
{
    configXML = new XML(e.target.data);
    trace(configXML.default_language);
    trace(typeof(configXML.abc));
    xmlLoader.removeEventListener(Event.COMPLETE, LoadConfigXML);
}

```

The 2nd trace command shows  
\*\*xml  
\*\*  
though I expect it to show undefined as the tag does not exist in the XML file. Same problem is with attributes.
