code: def add_element(self, element):
          
          try:
              self.toc[element.group][element.name] = element
          except KeyError:
              self.toc[element.group] = {}
              self.toc[element.group][element.name] = element
docs: Add a new TocElement to the TOC container.