public static void main (String [] args) throws JAXBException {
/**
* Create JAXB Context from the classes to be serialized
*/
StringWriter output = new StringWriter();
JAXBContext context = JAXBContext.newInstance(ServerStatus.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(ServerStatus.START, output);
System.out.println(output.toString());
/**
* Unmarshall
*/
Unmarshaller um = context.createUnmarshaller();
StringReader sr = new StringReader(output.toString());
ServerStatus serverStatus = (ServerStatus) um.unmarshal(sr);
System.out.println("Status : " + serverStatus);
}
}