(self)
return XPath.or_(first_visit, next_visits)
last_visit_num_{form_unique_id} = '' or if(@repeats = 'True',
        @id >= last_visit_num_{form_unique_id}, @id > last_visit_num_{form_unique_id}
last_visit_num_{form_unique_id} = '' or if(
last_visit_num_ { form_unique_id } = or if (
def next_visits(self):
        """last_visit_num_{form_unique_id} = '' or if(@repeats = 'True',
        @id >= last_visit_num_{form_unique_id}, @id > last_visit_num_{form_unique_id}
        """
        last_visit_repeat = XPath('@id >= {}'.format(self.last_visit))
        last_visit_no_repeat = XPath('@id > {}'.format(self.last_visit))
        next_visits = "if(@repeats = 'True', {}, {})".format(last_visit_repeat, last_visit_no_repeat)
        first_visit = XPath("{} = ''".format(self.last_visit))

        return XPath.or_(first_visit, next_visits)
def next_visits ( self ) : last_visit_repeat = XPath ( '@id >= {}' . format ( self . last_visit ) ) last_visit_no_repeat = XPath ( '@id > {}' . format ( self . last_visit ) ) next_visits = "if(@repeats = 'True', {}, {})" . format ( last_visit_repeat , last_visit_no_repeat ) first_visit = XPath ( "{} = ''" . format ( self . last_visit ) ) return XPath . or_ ( first_visit , next_visits )