Populating XML by binding external data
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="white"> <mx:Script>[Bindable] public var userid:int=0;</mx:Script> <mx:XML id="usersXML"> <root> <users> <user userid="{userid}">{myTextInput.text}</user> </users> </root> </mx:XML> <mx:Label text="Name:" /> <mx:TextInput id="myTextInput" change="myTextArea.text=usersXML.toXMLString()" /> <mx:TextArea id="myTextArea" width="250" height="100" /> </mx:Application>