Java XML JAXB Object to XML toXML(Object o)

Here you can find the source of toXML(Object o)

Description

to XML

License

Open Source License

Declaration

public static String toXML(Object o) 

Method Source Code


//package com.java2s;

import java.io.StringWriter;

public class Main {
    public static String toXML(Object o) {
        StringWriter writer = new StringWriter();
        javax.xml.bind.JAXB.marshal(o, writer);
        return writer.toString();
    }/* w w  w . j av  a2  s .com*/
}

Related

  1. toString(E e)
  2. toString(Object o, Class clazz)
  3. toXml(Class className, Object object)
  4. toXML(final Object obj, final boolean prettyPrint)
  5. toXml(final T dto)
  6. toXML(Object o, OutputStream os)
  7. toXml(Object o, OutputStream output)
  8. toXml(Object obj)
  9. toXml(Object object)