The formula for XP gained in a single battle, by the way, is 4/R when attacking and 2/R when defending, rounded down to the nearest integer with a minimum of 1. R is the ratio of your unit's effective strength to the enemy unit's effective strength. Note that it's effective strength, meaning after the modifiers are taken into account (it's the number displayed for each unit when you hover over the enemy to check your odds). So winning an even battle gives you 4 XP, and winning, say, a 10 vs. 5 battle gives you 2 XP. Note that first strikes don't alter your unit's effective strength, so the Drill line of promotions can give you an advantage in a battle without reducing the XP you gain from it.