private <T> String marshallRequest(T object) {
try {
IBindingFactory jc = BindingDirectory.getFactory(object.getClass());
IMarshallingContext marshaller = jc.createMarshallingContext();
StringWriter writer = new StringWriter();
marshaller.marshalDocument(object, "UTF-8", null, writer);
return writer.toString();
} catch (JiBXException e) {
throw new IllegalStateException("Error marshalling request object " + object.getClass(), e);
}
}