Binding XML to DataGrid
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import mx.collections.XMLListCollection; </mx:Script> <mx:XML id="itemData" xmlns=""> <items> <item id='1'> <name>Name 1</name> <type>Type 1</type> <description>Desc 1</description> </item> <item id='2'> <name>Name 2</name> <type>Type 2</type> <description>Desc 2</description> </item> </items> </mx:XML> <mx:DataGrid width="200" dataProvider="{new XMLListCollection(itemData..item)}"> <mx:columns> <mx:DataGridColumn dataField="name" /> <mx:DataGridColumn dataField="type" /> </mx:columns> </mx:DataGrid> </mx:Application>