protected Element marshallMessage(final XMLObject message) throws MessageEncodingException {
        LOGGER.debug("Marshalling message");

        try {
            return XMLObjectSupport.marshall(message);
        } catch (final MarshallingException e) {
            throw new MessageEncodingException("Error marshalling message", e);
        }
    }
Helper method that marshalls the given message.

@param message message the marshall and serialize
@return marshalled message
@throws MessageEncodingException thrown if the give message can not be marshalled into DOM
pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPRedirectDeflateEncoder.java