code: def add_word(self, word):
          
          word_id = self.get_element_id(word)
          if word.getparent().tag in ('node', 'sentence'):
              parent_id = self.get_parent_id(word)
          else:
              # ExportXML is an inline XML format. Therefore, a <word>
              # might be embedded in weird elements. If this is the case,
              # attach it directly to the closest <node> or <sentence> node
              try:
                  parent = word.iterancestors(tag=('node', 'sentence')).next()
                  parent_id = self.get_element_id(parent)
              except StopIteration as e:
                  # there's at least one weird edge case, where a <word> is
                  # embedded like this: (text (topic (edu (word))))
                  # here, we guess the sentence ID from the
                  parent_id = self.get_element_id(word).split('_')[0]
  
          self.tokens.append(word_id)
          # use all attributes except for the ID
          word_attribs = self.element_attribs_to_dict(word)
          # add the token string under the key namespace:token
          token_str = word_attribs[self.ns+':form']
          word_attribs.update({self.ns+':token': token_str, 'label': token_str})
          self.add_node(word_id, layers={self.ns, self.ns+':token'},
                        attr_dict=word_attribs)
          self.add_edge(parent_id, word_id, edge_type=dg.EdgeTypes.dominance_relation)
          self.parse_child_elements(word)
docs: Parameters
          ----------
          word : etree.Element
              etree representation of a <word> element
              (i.e. a token, which might contain child elements)