I'm currently swapping a 4.0 from a '98 XJ into my '86 CJ. Immediately before this, I had the original 258 with a Howell TBI that had already been bored .060 over, and had started blowing oil. I figured I could either get a reman long block from ATK or S&J (~$1500), or find a wrecked XJ/TJ and pull the engine from that.
I found an engine from a '98 XJ not far from me and the price was right, so I went and picked it up. Most of the write-up's I've seen regarding doing a 4.0 swap are directed toward the OBDI system that was produced '91-'95. OBDII is the more current system that was around from '96 to '01 or so.
Mechanically, there is little to no difference between the two. Pretty much all the differences are in the sensors and communications protocol.
As of now, I've competed the physical swapping of the engines. That is to say, I've pulled my 258 out, and got the 4.0 bolted up to the frame and transmission. That was pretty straightforward. There were only a couple things that needed to be addressed, and these are common to all 4.0 swaps (as far as I can tell).
First, the pilot bushing from the 258 doesn't fit in the 4.0. I had read in several places that the recess in the 4.0 crank would be unfinished, and I'd have to measure the actual dimension and machine the bushing to fit. Well, my 4.0 had a finished bore, and it was 1.000". I had bought a couple stock 258 pilot bushings from RockAuto for ~$4 ea, so I took one and turned it down on a lathe to fit. Slid right in.
Second, I had to add a hole and make a bracket for the Crank Position Sensor on the bellhousing. I simply followed instructions found here
. Again, this is common to the OBDI and OBDII setups.
Third, the motor mounts from the 258 bolt right up to the 4.0. There is one bolt that is not like the others... The rear-most bolt on the drivers side of the block is M12 thread, not 3/8-16 like the others. This requires drilling out the bracket a little.
So, I've addressed these details and have bolted the engine in place. Very straight forward. Now on to the wiring and emissions equipment.
This is where the OBDII is different. Being that I want to continue to register this Jeep in California, I need to bring over all the emissions equipment from the '98. This includes the Cat (with O2 sensors up and down-stream), evap canister, evap purge solenoid, leak detection pump, CEL, and diagnostic port. I haven't actually completed this part yet, but I'll be sure to post updates and questions as I go.
EDIT: 5/22/16: Apparently ImageShack has decided to not let me link to my photos hosted on their "free" site unless I pay for a premium membership. So, many photos are not currently available.