a very fague question imo. I usually first create an xml template in a xml editor (scite,xmlmaker,notepad,...) and create sample scenarios on how the data should be stored in certain conditions.
So the first thing to code would be something that understand´s the xml structure and logic behind your generated file.
take for example the following xml file:
PHP Code:
<xml startPos="8,2">
<r>5,2,1</r>
<r>1,1,1</r>
<r>5,4,3</r>
</xml>
wich in this case represents a very simple level with a 2d grid (3*3 rows = 9 cells) and a X & Y start position.
if I wanted to read that xml file (I´ll name it sample.xml in this case) within flash I´d write something like this 1 the first frame:
PHP Code:
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = xmlInit;
xmlInit = function(ok){
if (ok){
readLevel(xml);
}else{
trace("no such XML file");
}
}
xml.load("sample.xml");
readLevel = function(xmlFile){
var pos = new Object();
pos.x = Number( xmlFile.firstChild.attributes.startPos.split(",")[0] );
pos.y = Number( xmlFile.firstChild.attributes.startPos.split(",")[1] );
trace("start position : "+pos.x+"/"+pos.y);
var map = new Array();
var node = xmlFile.firstChild.childNodes;
for (var i=1;i<=node.length;i++){
map[i-1] = new Array();
var tempRow = node[i-1].firstChild.nodeValue.split(",");
for (var j=1;j<=tempRow.length;j++){
var cell = Number(tempRow[j-1])
map[i-1].push(cell);
trace("cell x:"+i+",y:"+j+" = "+cell);
}
}
}
that way it should be possible to read this particular structure, if you want to save or store the xml data e.g getting it back you either can manipulate the xml object (rather not recomended) or run paralel array data such as the map array in my exemple and work with that one furtherone in your engine or editor. Manipulate the values and or add/remove them.
then write some xml string generator or xml object generator that backwards generates a xml string (something you can display in a textfield and or pass it to php to save it on the server) or an xml object and convert it to a string wich is basicly the same as it results in a String wich is XML code.
maybe there were some usefull insights for you