cool, thanks.
In the meantime I've tried with the other one, wrote everything and saved as create_XML.php.
But when I open it with firefox, I get this error:
XML Parsing Error: no element found
Location: http://localhost/create_XML.php
Line Number 94, Column 7:<data>
------^
the output file seems to be correct, but firefox doesn't recognize it as xml.
Maybe there is another closure tag or command that I'm missing? Eg, something to say that the XML file is finished?