Award the XP at the end of the adventure/mission rather than session-by-session, and make the primary determinant of the XP award how well the party accomplished the goal/mission and how much each character contributed to that accomplishment, consistent with that character's role. The per-encounter XP formula only works if the goal/mission of the adventure is "have as many encounters as possible" (just like the OD&D/1E XP-for-gp formula only works if the goal/mission of the adventure is "gather as much loot as possible") and if the goal of the adventure is something other than that then you're going to have to adjust the XP-awarding metrics accordingly.