You can train your Pokémon in a friendly battle, where you select a single Pokémon to battle against another Pokémon in a friendly Gym. The more you train, the more Prestige you can earn for your team’s Gym. (Source)
Provided you have the potions to heal your Pokemon, can you battle back-to-back and select the same trainer every time to battle, increasing Prestige and getting an XP bonus every time?
The wording of the official Niantic Labs source makes it seem as if you can select which trainer in a friendly gym you want to battle (and so I assume that is true). Is there a cooldown, or possibly do you have to battle the next trainer after defeating the first?