You can use position( 2 dots ), see ODK XForms Specification.
And with the search function of this forum, you can find more hints, e.g. Is there a way to capture the current index of the repeating group?.
So, you use a calculate type variable with calcultion position( 2 dots ). Then you can $-reference this variable, for ex. in the label of a group, a question or a note.