}
}
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(selectedFile));
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("UTF-8");
XMLWriter xmlWriter = new XMLWriter(bos, format);
xmlWriter.write(document);
xmlWriter.flush();
xmlWriter.close();
LOG.info(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(), "File xml saved."));
} else {
LOG.error(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),
"Error saving xml file, output file is null."));
}