I think you have a 904 or 909, I´d take a close look at the
CPS sensor position, the length of the tranny and the spline count. The AW4 would be a logical upgrade, 4 speed and actually an imrovement on the older 904 and 909. They built this tranny in most XJ´s until 98, you could probably get one delivered to your front door for around $700 or half that at a junk yard out of a late model XJ wrecked.
Also check the electrical connector, the AW4 worked somewhat with the computer, maybe your 909 is compatible maybe not.
You could probably find out what the differences are from TCI or another large re-manufacturer.
If you order, be sure to get a tested torque converter to go with the tranny. Your old coverter is probably full of junk and questionable.
If the AW4 is not compatible, the 999 is probably a good second choice, though also a 3 speed, a little more robust than the 904/909 series.
I'm fairly certain most all of the Jeep trannys had the standard Jeep bolt pattern. But asumming anything, is not wise.