Hi well i have started creating a Adobe Air xml editor AS3. it allows for adding new nodes so far. but what i need is for the current XML nodes to show in a datagrid, and i want the user to select any of the items from the grid, allowing them to edit the node for that item.

So basically i could ----- bind datagrid with the XML nodes, and make it editable, if any changes made it will change the xml instance. which is then saved to the xml file using filestream.

Just need to no how to see all the xml nodes in a datagrid, edit, delete or add nodes .. ANY METHOD IS FINE WITH ME! its really driving me mad.





Code:
import flash.filesystem.*;
var LoadXML=new URLLoader(new URLRequest("c://testObject.xml")) // Loading XML file
LoadXML.addEventListener(Event.COMPLETE,LoadXMLFunction) // on load of XML calls LoadXMLFunction
saveBtn.addEventListener(MouseEvent.CLICK,onSave) // on save button click calls onSave
var MainXML:XML;

function LoadXMLFunction(e:Event)
{
MainXML=XML(e.target.data) //Load all XML data from test.xml to MainXML
trace(MainXML)
}

function onSave(e:Event):void
{
var item:XML = <menuitem/> // Create one XML Node
item.itemname = ObjName.text // assign uid textbox value to userId node
item.itemname.@type = "Local"
item.category = objcat_cb.text  // assign pwd textbox value to pwd node
item.objecttype = objtype_cb.text
item.content = ObjDesc.text

MainXML.appendChild(item); // Append this xml item to MainXML 

var file:File = new File();
file = file.resolvePath("c:\\testObject.xml"); // open test.xml 
var fileStream:FileStream = new FileStream(); // Create new FileStream to Perform Read or Write
fileStream.open(file, FileMode.WRITE); // Open file in WRITE Mode
fileStream.writeUTFBytes(MainXML);  //Write MainXML xml content to the file test.xml
fileStream.close(); //Close the File Stream

}
i found this code whcih allows saving to xml file and adding nodes to the end (appendchild)