code: public static <T> String toXmlWithXMLEncoder(final T obj)
  	{
  		XMLEncoder enc = null;
  		final ByteArrayOutputStream baos = new ByteArrayOutputStream();
  		enc = new XMLEncoder(baos);
  		enc.writeObject(obj);
  		enc.close();
  		return baos.toString();
  	}
docs: Creates from the given Object an xml string.
  
  @param <T>
  the generic type of the return type
  @param obj
  the obj to transform to an xml string.
  @return the xml string