(House Rule -- Sorry)
This has happened to our party so many times I've lost count. It's really debilitating when you get energy drained and then (usually as a direct result) get killed. It's even worse when this happens when you're 50 XP away from your next level-up...
Our house rule on this one is to have energy drain and level loss from dying both affect XP as if your character had exactly enough to reach their current level. If you're 8th-level with 44,000 XP, for instance (not too far from 9th) and you lose a level from an energy drain attack, instead of dropping all the way back to 32,000 XP (half-way between 7th and 8th), you instead lose ((36,000 - 28,000) / 2) = 4,000 XP, leaving you on 40,000 XP and, most importantly, still on 8th-level.
In fact, the math is actually easier this way than with the current system: for every level lost (for whatever reason), lose ((current level * 1,000) / 2) XP. This way, if you're a 12th-level character who loses 2 levels from energy drain then gets killed and raised, that unfortunate feller drops by 18,000 XP (3 * (12,000 / 2)) and recalculates his totals to find his new character level. I'd much rather lose that than go from 83,950 all the way down to 50,000 (which is what could happen currently). At least, this way, I could conceive of still having a remotely playable character within the campaign (as opposed to suddenly becoming weaker than my buddy's cohort).