If an Ender Dragon has a DragonDeathTime of 200 or greater, it will infinitely spawn XP orbs and never disappear. The only way to remove this Dragon from your world to prevent it from creating lag is to edit your world data.
/summon ender_dragon ~ ~ ~ {Health:0,DragonDeathTime:200}
Can confirm. I reproduced this and it just infinitely floats upward.