try {
bfact = BindingDirectory.getFactory(StyledLayerDescriptorInfo.class);
IMarshallingContext mctx = bfact.createMarshallingContext();
StringWriter writer = new StringWriter();
mctx.setOutput(writer);
mctx.marshalDocument(obj);
if (log.isDebugEnabled()) {
log.debug(writer.toString());
}
} catch (JiBXException e) {
throw new SldException("Validation error", e);