View xml, exit and return to same place

Can anyone help with this please.

I have an xml file that loads with 5 sets of questions 1 through 5.
If I go to another frame when on say question 2, how would I write code to go back
to same question in set that I was last on???

Any help would be appreciated.