The Cherokee 4.0 block is the same as all 4.0 blocks, as I have read. It should bolt into the TJ frame with stock mounts. The transmission may be a stumble, most Cherokee's are automatic, so flywheel/clutch needed. The body will not bolt up, but you could fab new mounts off the frame for 'em, or find a TJ tub ($500 or so around here for a super-straight one, but then you'll need TJ everything-else (windshield, front clip, tops, gate...). I think fabbing YJ mounts onto the TJ frame would be cheaper if you have a complete body to bolt on.
I've read about a YJ tub dropped on a Rubi frame over on jeepkings a while back. It had a Chev v8 and whatnot so the powertrain stuff won't apply, but perhaps you can search that and find out about the body or frame modification options.
'91 Frankenheep YJ. 4.0, 4" BDS, Richmond 8.8, Titan 12k, 35" KM2's, rust.
'88 YJ, 4.2/4.0 head, +4½" & shackles, BFG 33's (sold)