if (!xmlFile.open(QIODevice.OpenModeFlag.WriteOnly, QIODevice.OpenModeFlag.Truncate)) {
lastError = 16;
errorMessage = "Cannot open file.";
}
writer = new QXmlStreamWriter(xmlFile);
writer.setAutoFormatting(true);
writer.setCodec("UTF-8");
writer.writeStartDocument();
writer.writeDTD("<!DOCTYPE NeverNote-Export>");
writer.writeStartElement("nevernote-export");