code: def _add_element(self, cls, **kwargs):
          
          # Convert stylename strings to actual style elements.
          kwargs = self._replace_stylename(kwargs)
          el = cls(**kwargs)
          self._doc.text.addElement(el)
docs: Add an element.