Serialize the value into a new element object and return the element.

        If the omit_empty option was specified and the value is falsey, then this will return None.

def serialize(
            self,
            value,  # type: Any
            state  # type: _ProcessorState
    ):
        # type: (...) -> ET.Element
        """
        Serialize the value into a new element object and return the element.

        If the omit_empty option was specified and the value is falsey, then this will return None.
        """
        # For primitive values, this is only called when the value is part of an array,
        # in which case we do not need to check for missing or omitted values.
        start_element, end_element = _element_path_create_new(self.element_path)
        self._serialize(end_element, value, state)
        return start_element