What engine and transmission? 4.0L/auto?
I would bolt in a used transmission for a few hundred bucks (make sure to flush the fluid out of the cooler lines and replace the torque converter as well.) You might consider using a 4x4 transmission with a transfer case on it and just leave it in 2wd, you will need the factory rear driveshaft from a 96-01 4x4 with the same motor + transmission + rearend but those are easy to find and fairly cheap.
Everything bolts up no problem, 4x4 transmissions are easier to find in junkyards (at least around here), and now you are closer to a 4x4 swap if you decide you want to do one in the future. Your ideal donor (assuming a 4.0/auto) for a transmission is a 98-01 XJ, ideal donor for the transfer case if you decide to do what I suggested above is a 96-01 XJ (probably the same vehicle as the transmission, why complicate things?), and ideal donor for the rear driveshaft is a 96-01 XJ with the same engine, transmission, and rear axle.
If you want to keep it 4x2, your donor is a 98-01 XJ and nothing else needs to be changed, just bolt it in with a cooler flush, a new torque converter (or the one from the trans donor), and new fluid.