const fileName = data.filePath;
const backupFileName = `${fileName}.opmltbackup`;
// Backup original file
const origXml = convertFileToXMLString(originalData);
await saveFile(backupFileName, new Blob([origXml], { type: 'text/xml' }));
await deleteFile(fileName);
// Save new file
const newXml = convertFileToXMLString(data);
await saveFile(fileName, new Blob([newXml], { type: 'text/xml' }));
// Cleanup
await deleteFile(backupFileName);