Fighting at an enemy Gym can be an effective way to gain
XP. Fortunately, the awards for defeating enemy Gyms are straightforward!
100XP is awarded for every Pokemon you defeat.
50XP bonus is awarded if you defeat the last Pokemon deployed at the Gym.
So defeating a level 10 Gym (with all 10 deployed Pokemon defending) will award you
1,050 XP for your efforts!