Sorting a list of things by another list of things

I’m really stuck with this one and I would guess that there is a pretty simple solution to it but I just can’t figuring it out. Here is my problem:

I have 2 lists of things:
1.) Templates
2.) Services

1 Service can have n Templates
1 Template belongs to 1 Service

There are quite a lot of Templates but only a few Services (e.g. Google Analytics, Wordpress,…).
I want to have a Repeating Group with all Templates.
The Repeating Group should be sorted by the Name of a Service the Template belongs to.

This would be the Repeating Group example I’m looking for:
Google Analytics | Template A
Google Analytics | Template B
Google Analytics | Template C
Wordpress | Template D
Wordpress | Template E

I have my Repeating Group data type set to Templates and do a “Search for all Templates” to get the data. This seems necessary to access the relevant Template information for each cell of the Repeating Group.
But how do I manage to sort the whole thing like shown above? Do I miss something trivial?