def repeat(self, rid, count, index=0):
        """
        Repeat an xml element marked with the matching rid.
        """
        elems = None
        if rid in self.__repeat_ids:
            elems = self.__repeat_ids[rid]
        elif rid in self.__element_ids:
            elems = self.__element_ids

        if elems and index < len(elems):
            elem = elems[index]
            self.__repeat(elem, count)
Repeat an xml element marked with the matching rid.