def __add_document_structure(self, docgraph,
                                 remove_redundant_layers=True):
        """return an Exmaralda XML etree representation a docgraph"""
        E = self.E
        root = self.__create_document_header()

        body = E('basic-body')
        timeline = E('common-timeline')

        # for n tokens we need to create n+1 timeline indices
        for i in xrange(len(docgraph.tokens)+1):
            idx = str(i)
            # example: <tli id="T0" time="0"/>
            timeline.append(E('tli', {'id': 'T'+idx, 'time': idx}))

        body.append(timeline)
        body = self.__add_token_tiers(docgraph, body)

        annotation_layers = get_annotation_layers(docgraph)
        for layer in annotation_layers:
            if not remove_redundant_layers:  # add all layers
                self.__add_annotation_tier(docgraph, body, layer)
            elif is_informative(layer):  # only add informative layers
                self.__add_annotation_tier(docgraph, body, layer)

        self.__add_coreference_chain_tiers(docgraph, body)
        root.append(body)
        return root
return an Exmaralda XML etree representation a docgraph