StringWriter buffer = new StringWriter();
HierarchicalStreamWriter out;
if (transformation.toLowerCase(Locale.ENGLISH).endsWith("json")) {
out = new JettisonMappedXmlDriver().createWriter(buffer);
} else {
out = new PrettyPrintWriter(buffer);
}
XStream xstream = getXStream();
xstream.setMode(XStream.NO_REFERENCES);
xstream.aliasPackage("", "org.apache.activemq.command");