if (finalFile.exists()) { finalFile.delete(); }
    public boolean write(INode node, String file)                  throws IOException {        // we definitly need a node        if (node == null) {            throw new RuntimeException("First argument in Xml.write() is not an hopobject");        }        if (file == null) {            throw new RuntimeException("Second argument file name must not be null");        }        File tmpFile = new File(file + ".tmp." + XmlWriter.generateID());        XmlWriter writer = new XmlWriter(tmpFile, "UTF-8");        writer.setDatabaseMode(false);        writer.write(node);        writer.close();        File finalFile = new File(file);        tmpFile.renameTo(finalFile);        core.getApplication().logEvent("wrote xml to " + finalFile.getAbsolutePath());        return true;    }