 <p>I've already tried to use commands.flush() before call the close() method, but this don't change anything.</p> <p>Instead, if I write more than one file, as an example file-1.xml, file-2.xml, file-3.xml, the files numer one and two was written before I closing the application and the file number three was written only after closing.</p>