code: def _to_message_element(self, element):
          
          if element is None:
              return None
          elif self._is_stringable(element) or self._is_qstring(element):
              return Text(element)
          elif isinstance(element, MessageElement):
              return element
          else:
              raise InvalidMessageItemError(element, element.__class__)
docs: Args:
              element the element to be checked and if necessary converted
  
          Returns:
              the correct element
  
          Raises:
              Errors are propagated