I tried looking for a thread where this is being discussed but couldn't find one.
In January a change was announced to the way defending heros get XP, here
Basically, the XP gained by a hero is based on the def points gained from the battle.
So, even if my standalone hero kills the same number of troops as the hero accompanying some def, my hero gets hardly any XP while the other gets loads.
Oh, and my hero will still lose health.
This seems very wrong to me.