disp.checkAccess(loginAnswer.getUserId(), service) && xmlDocName != null) {
InputStream is = null;
try {
XmlCreator creator;
if (type == ImportType.VARIABLES) {
creator = new XmlVariableCreator();
} else if (type == ImportType.XLIFF) {
String sourcelang = req.getParameter("sourcelang");
String targetlang = req.getParameter("targetlang");
creator = new XliffCreator(sourcelang, targetlang);
} else {
creator = new XmlTextCreator();
}
Document doc = creator.createFile(DbHandler.getConnection(),
xmlDocName);
//Write the xml/html document nicely
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding("UTF-8");