This is a very metagamey approach, but the easiest solution is to just gain a negative level and then recover it with restoration, as this will bring you up to the minimum xp required for your ECL.

There is also no ECL20 limit for NPCs, a great wyrm can take class levels as much as he’d like. NPCs also do not need to follow the same XP rules as players, and can just be given class levels as you desire.