<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_layer(self, words_file, connected):
 """ parses a _words.xml file, adds every token to the document graph and adds an edge from the MMAX root node to it. Parameters connected : bool Make the graph connected, i.e. add an edge from root to each token. """

        for word in etree.parse(words_file).iterfind('//word'):
            token_node_id = word.attrib['id']
            self.tokens.append(token_node_id)
            token_str = ensure_unicode(word.text)
            self.add_node(token_node_id,
                          layers={self.ns, self.ns+':token'},
                          attr_dict={self.ns+':token': token_str,
                                     'label': token_str})
            if connected:
                self.add_edge(self.root, token_node_id,
                              layers={self.ns, self.ns+':token'})