code: public static String toXml(final Object obj) {
  		final ByteArrayOutputStream out = new ByteArrayOutputStream();
  
  		// XStream x = createXStream();
  		// String xml = x.toXML(obj);
  		// return xml;
  		final XMLEncoder e = new XMLEncoder(out);
  		e.setExceptionListener(new JKObjectUtil.XmlEncoderExceptionListener());
  		// e.setPersistenceDelegate(Object.class, new MyPersistenceDelegate());
  		e.writeObject(obj);
  		e.close();
  		return out.toString();
  		// return null;
  	}
docs: ////////////////////////////////////////////////////////////////////