The following is an example of how to use the XML2VO.as util to quickly map data from xml into a typed object.

private var loader:URLLoader;
private var exampleVO:ExampleVO;

private function init():void 
{
	exampleVO = new ExampleVO();
	var url:String = "config.xml";
	loader = new URLLoader();
	var request:URLRequest = new URLRequest(url);
	loader.addEventListener(Event.COMPLETE, OnLoadComplete);
	loader.load(request);
}

First you’ll need to load or embed your xml object.

private function OnLoadComplete(e:Event):void 
{
	XML2VO.map(XML(loader.data), exampleVO);
}

Then on load complete simply call XML2VO.map and pass in the xml data along with the object you’d like the data mapped to.

example source xml is as follows:



	1, 3.2, test
	60
	30.45
	http://google.com
	0xded6ce
	0xded6ce, 0xd1d6e0, 0xcddce2
	
		
			test.jpg
		
	

and ExampleVO is as follows:

package  
{
	public class ExampleVO 
	{
		public var arrayExample:Array;
		public var intExample:int;
		public var numberExample:Number;
		public var stringExample:String;
		public var uintExample:uint;
		public var vectorExample:Vector.;
		public var xmlExample:XML;
	}
}

private function OnLoadComplete(e:Event):void 
{
	XML2VO.map(XML(loader.data), exampleVO);
	MonsterDebugger.initialize(exampleVO);
}

By using MonsterDebugger to display the content of exampleVO you can see that the xml data has successfully been mapped into our as3 object.
monsterDebugger1

Source code can be downloaded from github