def serialize(
            self,
            value,  # type: Any
            state  # type: _ProcessorState
    ):
        # type: (...) -> ET.Element
        """Serialize the value and returns it."""
        xml_value = _hooks_apply_before_serialize(self._hooks, state, value)
        return self._processor.serialize(xml_value, state)