Ok - to the question of writing back XML files.
This is something that's supported in DB 6.2 Beta which is available for download for windows only at the moment. You can use this function call in ogScript:
var success = ogscript.saveToFile('[path]', '[data]', [overwrite]);
function callback(success, sourceFilePath, exception)
{
overwrite, if true will cause any existing file to be overwritten. I don't know what happens if it's false and there's an existing file. It may throw an exception, or it may just append. I'll experiment with this.
data is either a string, or byte array that you want to write to the file, OR (and this is the good bit) an XML document object, such as created by the ogscript.parseXML() method.
I think this is just what you need - let everyone here know if it helps!
John
#DashBoard