<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __add_span_tier(self, tier):
 """ adds a tier to the document graph in which each event annotates a span of one or more tokens. """

        tier_id = tier.attrib['id']
        # add the tier's root node with an inbound edge from the document root
        self.add_node(
            tier_id, layers={self.ns, self.ns+':tier'},
            attr_dict={self.ns+':category': tier.attrib['category'],
                       self.ns+':type': tier.attrib['type'],
                       self.ns+':display-name': tier.attrib['display-name']})
        self.add_edge(self.root, tier_id, edge_type=EdgeTypes.dominance_relation)

        # add a node for each span, containing an annotation.
        # add an edge from the tier root to each span and an edge from each
        # span to the tokens it represents
        for i, event in enumerate(tier.iter('event')):
            span_id = '{}_{}'.format(tier_id, i)
            span_tokens = self.gen_token_range(event.attrib['start'], event.attrib['end'])
            annotation = event.text if event.text else ''
            self.add_node(
                span_id, layers={self.ns, self.ns+':span'},
                attr_dict={self.ns+':annotation': annotation,
                           'label': annotation})
            self.add_edge(tier_id, span_id, edge_type=EdgeTypes.dominance_relation)

            for token_id in span_tokens:
                self.add_edge(span_id, token_id,
                              edge_type=EdgeTypes.spanning_relation)