JDOMSource in = new JDOMSource(doc);
Format format = Format.getPrettyFormat();
//format.setEncoding(encoding);
XMLOutputter outp = new XMLOutputter(format);
File f = new File(filename);
outp.output(in.getDocument(), new FileWriter(f));
//system.out.println("xml datei wurde gespeichert: " + f.getCanonicalPath());
//system.out.println("********************************************************************");
} catch (Exception e) {
try {
new ErrorLog("error in " + sos.util.SOSClassUtil.getMethodName() + " .Could not save file " + filename , e);