Thread exportThread = new Thread() {
public void run() {
try {
BufferedWriter writer = new BufferedWriter( new FileWriter( f ) );
XmlExporter exporter = new XmlExporter( writer );
exporter.addListener( tthis );
exporter.write();
writer.close();
} catch (IOException ex) {
ex.printStackTrace();
}