public String toXML(final Object obj){
  final Writer writer=new StringWriter();
  toXML(obj,writer);
  return writer.toString();
}

public String toXML ( final Object obj ) { final Writer writer = new StringWriter ( ) ; toXML ( obj , writer ) ; return writer . toString ( ) ; }
serialize an object to a pretty - printed xml string .
