I handle it with a few days of downtime while the party is in a safe area with reasonable facilities for training and resting. In practice, this usually means in town as the party returns from a mission.
I typically do not award XP for individual encounters, but for completing quests. But if I have a dungeon guarding the princess they need to save, the total XP award will still be based on the opposition guarding the princess.