marshaller.marshal(order, writer);
String orderString = writer.toString();
logger.debug("Order converted to XML:\n" + orderString);
// Write out the schema (for debugging purposes)
jaxbContext.generateSchema(new DefaultSchemaOutputResolver("target"));
// Read it from XML
Order orderRead =
(Order)jaxbContext.createUnmarshaller().unmarshal(
new StringReader(orderString));