Using XML data models and use it as data for Tree control
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:XML id="chaptersXml"> <chapters label="Chapters"> <chapter label="Chapter 1"> <file label="File 1.1" /> </chapter> <chapter label="Chapter 2"> <file label="File 2.1" /> </chapter> </chapters> </mx:XML> <mx:VBox> <mx:Button click="chapters.dataProvider = chaptersXml" /> <mx:Tree id="chapters" width="200" labelField="@label" /> </mx:VBox> </mx:Application>