code: def serialize(
              self,
              value,  # type: Any
              state  # type: _ProcessorState
      ):
          # type: (...) -> ET.Element
          
          dict_value = self._converter.to_dict(value)
          return self._dictionary.serialize(dict_value, state)
docs: Serialize the value to a new element and returns the element.