I have the following XML source structure:
This should do the trick, you'll need to do some further work to select the distinct repid's
repid