code: public static void objectToXML(Object object, String fileName) throws FileNotFoundException {
  		FileOutputStream fo = new FileOutputStream(fileName);
  		XMLEncoder encoder = new XMLEncoder(fo);
  		encoder.writeObject(object);
  		encoder.close();
  	}
docs: Converts an object to an XML file.
  
  @param object The object to convert.
  @param fileName  The filename where to save it to.
  @throws FileNotFoundException On error.