@classmethod
def get_xpath_distance(cls, path1, path2):
    """
        Calculate distance between paths.
        Can be used for cost calculation of moved nodes.
        Path seperator has to be /.

        :param path1: source xpath
        :param path2: destination xpath
        """
    _arr1 = path1.split('/')
    _arr2 = path2.split('/')
    while True:
        if _arr1 == [] or _arr2 == []:
            return len(_arr1) + len(_arr2)
        if _arr1[0] == _arr2[0]:
            _arr1 = _arr1[1:]
            _arr2 = _arr2[1:]
        else:
            return len(_arr1) + len(_arr2)
