According to kastein's AW4 thread, we're gonna need a 98-01 AW4 to do the swap due to a slightly different design that requires machining.
Copied from the first post in the thread:
If you have a 1998-2001 XJ:
1987-1997 AW4s are not going to work without significant machine work. Reason is that your TCU is expecting an input speed sensor signal, but the mounting boss for the ISS is not machined out on the donor transmission housing and the rotor needed is not installed in the geartrain. You will be fully disassembling the donor transmission, doing specialized machining on the housing, swapping some parts from your old transmission, and basically doing a massive amount of work to swap in a non-ideal part. I would not suggest this swap unless you are really, really screwed and don't care that your CEL will be going off and you will have to leave the transmission unplugged from the wiring harness and shift it manually, with no second gear available. This swap is also fine if you are going to be building a trail only rig, don't care about your CEL going off all the time, and will be installing a custom shifter setup. You could also swap in a proper-year manual transmission XJ ECU and install a custom shifter setup to avoid a CEL.