Jeep CJ's used 21 splines and some of the older XJ's used 21 spline with their NP231, but as I understand it they phased all that out well before 1990. The vast majority of transfer cases out there are 23 spline along with our AMC Eagles. The TF998 has room and I'm confident it accepts all three input heights. I've heard of some combinations of Jeep transmissions not having room for the taller inputs, but never that problem with the stickshifts or automatics found in AMC Eagles.
All 249, 247, and 242 transfer cases have the same forward casting and are very closely related. Your XJ NP231 is totally different, with a different number of bolts holding the front and rear halfs together. The Eagle transfer cases actually have the 249/242/247 bolt pattern to the case halves and are obviously direct ancestors.
I bolted a 242 into my Eagle with the original driveshafts. I have information about that in my project thread, "Perkiomen Project Pics." Essentially you take the long front yoke off and put on the shorter Eagle yoke, which shares the same splines and bolts directly on. Then I put a slip yoke on the original Eagle Ujoint and a 3" piece of pipe inside the old slip yoke. I drove for years with no vibrations and it cost less than $40 to install, including the purchase of the 242.