<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_token(self, token, parent_node='root'):
 """add a token to this docgraph"""

        if parent_node == 'root':
            parent_node = self.root

        token_node_id = 'token:{}'.format(self.token_count)
        self.add_node(token_node_id, layers={self.ns, self.ns+':token'},
                      attr_dict={self.ns+':token': token})
        self.add_edge(parent_node, token_node_id,
                      layers={self.ns},
                      edge_type=EdgeTypes.spanning_relation)
        self.tokens.append(token_node_id)
        self.token_count += 1