Re: engine swap
Divide the question into electrical and mechanical.
For the electronics, you just take the sensors and stuff out of the ZJ engine and install them in the donor. Look at things like fuel injectors and ignition part numbers to see if they are the same, and if not then switch them.
For mechanical issues, go to a junkyard and look at the stuff that's bolted on. The most obvious difference s that the ZJ only has one big fan in the middle that is driven by the water pump, while the XJ has two fans, one of which is driven by an off-set fan pulley. The rest of the engine layout is similar but the ZJ has different parts. But you should be able to switch the main passenger-side accessory brackets and all of the accessories and have an identical setup. Also check the power steering pump and tensioner assembly on the drivers side of the eingine, it may also be different. You'll also have to change exhaust manifolds, although the intake should be similar or the same.
So basically, after you switch all of the parts from your current engine onto the donor, it will bolt right up