There is no hard cap where you stop gaining XP after so many levels, no matter how much content is left. The cap is soft: you stop gaining XP when there are no more things which can grant you XP.