public void marshal(Object obj, Result result) throws JAXBException {
if (!(obj instanceof XMLSerializable) || obj == null)
throw new MarshalException(
Messages.format( Messages.NOT_MARSHALLABLE ) );
XMLSerializable so = (XMLSerializable) obj;
if (result instanceof SAXResult) {
write(so, ((SAXResult) result).getHandler());
return;
}