public void testJSON2XML() throws Exception {
JSON2XMLStreamReader t2 = new JSON2XMLStreamReader();
XMLStreamReader reader2 = t2.transform(new JSONObject(JSON_STR), null);
StringWriter sw = new StringWriter();
XMLStreamWriter streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
new XMLStreamSerializer().serialize(reader2, streamWriter);
streamWriter.flush();
Assert.assertTrue(sw.toString()
.contains("<xsl:root xmlns:xsl=\"http://foo.com\"><data>my json string</data></xsl:root>"));
}