Flex already has a Tree component. If you want something different then you'll have to extend the Tree component and add the additional features or build one from scratch so it will fit your needs perfectly.
EDIT: In case I didn't understand you right then a tree like structure can always be achieved with XML.
With best regards,
Currently I am getting data from a MYSQL DB and converting it into an XML format and then sending it toFlex. This XML is set as the source of a Hierarchical Data Object in flex which is the data provider of the Adv data grid. But I am not able to properly convert that data into an XML format...