edit: I know this is just my opinion on diesel swaps for the XJ. You guys do what you want, I just give my point of view. Diesel engines have become quite popular on this side of the ocean, and I've seen quite a few older small- to mid-size diesel engines that have amazing power and torque. I'm far from being expert on diesels, but I've seen enough to be really amazed what these smallish (~2.5-4.0 litre) turbo diesels can do when tuned right and then installed in midsize vehicles.
A gas GM 350 is a really tight fit in an XJ, there is no way a full size diesel is going to fit under the hood.
Why would you want to put a full size diesel onto a Cherokee, which is a mid-size vehicle?
Engines like Datsun/Nissan SD33 with a turbo would be a good option (almost the same size as the 4.0), older Merc straight-6 diesels are great engines that can withstand and generate huge amounts of power/torque (we're talking about 250hp+, 300lbs/ft+ of torque), you can swap in a 2.7crd (I5) or 3.0crd (v6) merc diesel (newer merc. engines aren't the very best or cheapest engine choises though), just to name a few. There are a bunch of diesels from mid-sized vehicles that can produce enough power/torque to overwhelm the 4.0 if tuned right.
IMO there is absolutely no point in trying to shove in a Cummins 4bt into such a small vehicle, because there are much better diesel swap options for the XJ.
Unlike you wrote, you CAN gain significant gains in MPG, and even power with diesel engines. Depending on the engine and its age, it might be a very simple engine with just a few wires, put a manual or auto tranny behind it, adapter plate and the TC of your choise. Itcan have as much, or even more low-end torque as the beloved 4.0
But you have to remember, that when doing such a swap, it might take a LONG time to cover the swap costs by the reduced fuel consumption. It can even take forever
So you really gotta think if there is a point in doing such a swap or not.
Just MPG-wise to save money, I'd say no unless you can get your engine/tranny/brainbox/etc... very cheap. If you want a diesel because of the simplicity of it, you need to buy an old-school (turbo)diesel than can be easily tuned for good performance. As they need pretty much no electrical stuff (glow plugs, starter, that's about it), with a snorkel you can run them in almost anywhere. Those engines don't care if you submerge them under water or mud for half a day or more
Would I do a diesel swap? Nope. Why? Because I don't want to. I don't do mudding/ submerge my XJ under water that much, so I can live with a computer controlled engine. If I did swap to a diesel? It'd be a merc I6 from early 80s. Great little engines they are. Would I swap to a 2.7crd or 3.0 crd.. nope, propably not unless I got it for free.
I'd stay away from the 2.5 and 2.8 Cherokee/ Liberty inline-4 diesels, they are built by VM Motori and will develop a whole lot of problems if they have been even slightly mis-treated in their earlier life. The 2.7crds have a tendency to crack intake manifolds (plastic), and also injectors/ injector units are known to crap out on you. Spare parts are very expensive.