Loading XML Data then Saving it [FMX2k4]

I have a load of XML files that I am in need for reformatting and because I have been working with Flash alot recently, I’m familiar with the XML tools and decided that it would be the best choice to reformat the files.

So, right now, I’m loading the files in using XML Objects and then just using a recursive loop to cycle through all the nodes and do what I need to. Now, is there any easy way that I can save the update data back into the same XML file I loaded it from? Since this isn’t going to be going into any sort of public use, it’s all being run directly from the Flash interface. Any suggestions on an easy way to do this?

Just so you have an idea of what I’m doing, here’s an example:


<root >
	<cm1 label=&quot;Company Name&quot; assignedUsers=&quot;user1, user2&quot;>
		<bf1 label=&quot;BCS&quot; assignedUsers=&quot;&quot;>
			<bu1 label=&quot;BCS&quot; assignedUsers=&quot;User12, User3&quot;>
		    	<bp1 label=&quot;This is the first BP Label&quot; assignedUsers=&quot;User4, User8&quot;/>
		    	<bp2 label=&quot;Another BP&quot; assignedUsers=&quot;User 1&quot;/>
		    	<bp3 label=&quot;The third BP&quot; assignedUsers=&quot;User666&quot;/>
Continues on with more bp, bu, and bf nodes

Now, I’m not sure why the guy before me did it this way, but what I would am doing is changing it so that each nodes name isn’t bp#, but just bp (or bf, or bu, etc.) and adding another attribute node called ID with the associated number. I’m also looking at doing something with the assignedUsers node to make it easier to work with (ie, easier to query with XPath). So it will hopefully look something like this:


<root >
	<cm ID=&quot;1&quot;>
		<bf ID=&quot;1&quot; label=&quot;BCS&quot; ...
			<bu ID=&quot;1&quot; label=&quot;BCS&quot; ...
				<bp ID=&quot;1&quot; ...
				<bp ID=&quot;2&quot; ...
				<bp ID=&quot;3&quot; ...
				<bp ID=&quot;4&quot; ...
				<bp ID=&quot;5&quot; ...