def path(self, separator="/"):
        """:returns: a string representing the path to root element separated by separator"""
        rt = ""
        for i in reversed(self):
            rt = "{}{}{}".format(rt, i.name, separator)
        return rt[:-1]
def path ( self , separator = "/" ) : rt = "" for i in reversed ( self ) : rt = "{}{}{}" . format ( rt , i . name , separator ) return rt [ : - 1 ]
:returns: a string representing the path to root element separated by separator