Hi.

I am trying to create a general XML file which should be created through a
function, i.e. BuildXml(levels:Number, numNodes:Number);
Using appendNode() is ok for simple XML with 2-3 node levels and 5-6 nodes per
level.

As this XML will be much bigger (the node levels and the total nodes per level
are parameters for this function, so depending of the project it could generate
XML with 20 levels depth and 300 nodes per level (Now don't ask why don't I use
a DB, cauz there is a reason for all this).

appendChild() is putting everything on 1 line. So at the end I could have a
well-formed XML with hundred nodes in it, and all of them placed on 1 line.

My question:
Is it possible to fix indent and new lines for every node directly in Flash
and to parse it into a TextField?

Some possible solutions I found but not the best ones for my project.
- XSLT Output - need to export the XML code in a server-side page, which to
transform it and return it in a HTML TextArea.
- The one lined code in Flash TextField to be edit and copy in a good XML
editor like OxygenXML and to be well-formatted there.

But I need something which to do the work inside the SWF file without the need
of a server-side or loading different piece of software to fix it.


Any ideas?


Thanks,
Dimitar