The engine will bolt up to your old transmission with NO modifications, other than swapping in your old CPS. However, the 42RE is a Chrysler elctonically controlled tranny and your XJ doesn't have an integrated PCM (Power Control Module) to control it, so short of re-wiring your XJ to make it into an electronic clone of a 99 Grand (which, BTW, is a WJ, not a ZJ) -- it ain't gonna work.
Therefore, unless you can buy the whole mess for the price on the engine alone, skip the deal.