code: public static void writeObjectAsXml(File dest, Object bean) throws IOException {
  		XMLEncoder xmlenc = null;
  		try {
  			xmlenc = new XMLEncoder(FileUtil.getOutputStream(dest));
  			xmlenc.writeObject(bean);
  		} finally {
  			// 关闭XMLEncoder会相应关闭OutputStream
  			IoUtil.close(xmlenc);
  		}
  	}
docs: 将可序列化的对象转换为XML写入文件，已经存在的文件将被覆盖<br>
  Writes serializable object to a XML file. Existing file will be overwritten
  
  @param dest 目标文件
  @param bean 对象
  @throws IOException IO异常