This could work for both fighting/healing magics:
Little/MuchXpFromCastingSmall/BigSpell + ( AmountOfWoundsHealed/Damaged * XPForHealing/DamagingWounds )
This one could work for buffing spells:
Little/MuchXpFromCastingSmall/BigSpell + ( ( TimeTheSpellLasts + HowGoodProtection/EnhancementTheSpellGives ) * XPForCastingBuffSpell )
Now if this doesn\'t make sense, I\'ll just try and explain it quickly.
When you heal/damage, you get XP for the amount of wounds healed/damaged, as well as XP for the spell itself.
When you buff, you get XP for how long and how protective/helpful the spell is, as well as for the spell itself.
I\'m not sure that you can prevent \"cheating\" with the buff spell one, as making it give XP only by casting it on others would be weird, but at least the healing formula should work good enough... However, I have no idea how the Devs are gonna solve this magic stuff.

Edit: Typos