public static void writeObject(final String path, Object obj)
{
XStream xstream = new XStream(new DomDriver());
try {
FileWriter fw = new FileWriter(path);
xstream.toXML( obj, fw );
}
catch (IOException ex) {
JOptionPane.showMessageDialog( null, "Could not write object:\n"+ex.getMessage());
}
catch(XStreamException ex){