That's why you don't level up until after the action that gets you infinite xp. And if you do not have a true infinite HD, there WILL be an infinite number of creatures with an NI CR on an infinite plane. So as long as you don't level up to infinity before you get infinite xp, you're fine on that front.
EDIT: basically, what this means is that in order for Pun-Pun to have infinite xp (and thus infinite levels in every class, with infinite HD), all he needs to do is have a truly infinite reach, and his infinite stats. Anything that does truly infinite damage with an infinite area (or targets an infinite number of creatures) will net him infinite xp.
Alternatively, anything that provides xp, as long as he can do a true infinite number of those actions (so in any finite amount of time, accomplishes a true infinite number of the actions) will net him infinite xp.