*
* @throws JMSException if an error occurs during the marshal operation.
*/
protected String marshall(Serializable object, String transformation) throws JMSException {
StringWriter buffer = new StringWriter();
HierarchicalStreamWriter out;
if (transformation.toLowerCase(Locale.ENGLISH).endsWith("json")) {
out = new JettisonMappedXmlDriver(new Configuration(), false).createWriter(buffer);
} else {
out = new PrettyPrintWriter(buffer);
}