It's easy to export one story to an XML file:
(this will export the story your cursor is in), but exporting more than one story into the same file is a problem. It's possible to loop over all stories and export them one by one, but:
1. You need to write them to separate files (because that's how exportFile works), and
2. You cannot automatically glue them together into one file afterwards. Each XML file starts with a header, and after that ech XML file should only contain one single root object.
Depending on your exact needs, it might be possible to do the XML export "manually", i.e., opening a new file, writing the XML header and root tag, then loop over each story (adding yet another 'enclosing' tag) and each story's XMLElements and outputting them one by one.
I've found one solution to put all storie in a collection
So, I have a problem to write in the xml out file
this is my code
// Création de l'arbre XML
var myXmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
myXmlString += "<Index />";
var myXml = new XML(myXmlString);
myXml.name = myDocument.fullName.name;
and this return an error like "XML does not have a costructor"