### Question:
JaxbMapper { public static <T> BodyReader<T> xml(Class<T> type) { return INSTANCE.reader(type); } JaxbMapper(boolean formatted); static BodyReader<T> xml(Class<T> type); static BodyWriter xml(Object value); BodyReader<T> reader(Class<T> type); BodyWriter writer(Object value);  }### Answer:
@Test public void testToXml() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); xml(new Hello("world")).writeTo(out); String s = new String(out.toByteArray()); assertThat(s, equalTo("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><hello><name>world</name></hello>")); }
@Test public void testFromXml() throws Exception { String json = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><hello><name>world</name></hello>"; Hello hello = xml(Hello.class).readFrom(new ByteArrayInputStream(json.getBytes())); assertThat(hello.getName(), equalTo("world")); }