Reads an RST tree (from an ElementTree representation of an URML
        XML file) and adds all segments (nodes representing text) and
        relations (nonterminal nodes in an RST tree as well as the
        relationships that hold between them) to this
        URMLDocumentGraph.

        Parameters
        ----------
        document_elem : lxml.etree._Element
            etree representation of a <document> element of a URML XML file
        tokenize : bool
            If True, the RST segments (i.e. nuclei and satellites) will
            be tokenized and added as additonal token nodes to the
            document graph (with edges from the respective RST segments).
            If False, each RST segment will be labeled with the text it
            represents.

def __urml2graph(self, document_elem):
        """
        Reads an RST tree (from an ElementTree representation of an URML
        XML file) and adds all segments (nodes representing text) and
        relations (nonterminal nodes in an RST tree as well as the
        relationships that hold between them) to this
        URMLDocumentGraph.

        Parameters
        ----------
        document_elem : lxml.etree._Element
            etree representation of a <document> element of a URML XML file
        tokenize : bool
            If True, the RST segments (i.e. nuclei and satellites) will
            be tokenized and added as additonal token nodes to the
            document graph (with edges from the respective RST segments).
            If False, each RST segment will be labeled with the text it
            represents.
        """
        for segment in document_elem.iter('segment'):
            self.__add_segment(segment)
        for relation in document_elem.iter('parRelation', 'hypRelation'):
            self.__add_relation(relation)

        # each discourse docgraphs has a default root node, but we will
        # overwrite it here
        old_root_id = self.root
        # the easiest way to find the root node of a URML graph is to find the
        # origin of the longest path
        root_id = nx.algorithms.dag_longest_path(self)[0]
        self.root = root_id
        # copy metadata from old root node
        self.node[root_id]['metadata'] = self.node[old_root_id]['metadata']
        # finally, remove the old root node
        self.remove_node(old_root_id)