easiest bet by far is an LS swap-- why shy away from it? ls-1's are pretty cheap, and part are plentiful. Hell, do a vortec. If you put a 350 in, you're going to do just about the same amount of work, for something not as powerful.
I did a 350 swap... got the block practically for free, and regretted it. depending on what 350 you get, it won't be all that much more powerful than what you have.. And if you go for a modern 350 (a zz6-- which I ended up swapping in- -400hp), it'll cost you just about as much as a new ls-1.
As for 5.2/5.9 -- believe it or not, it's a royal PITA to swap. Chevy is far simpler, mostly because the adapters are far more readily available for a chevy. And I had a 1998 grand Cherokee with a 5.9. Yeah, it was a great motor at the time, but still, only had around 220 hp/300ish tq. it was good for the time, can't touch a modern small block.
My heartfelt advice -- stroke it. You'll get a bunch more power, won't have to deal with the headache of swapping.
But if you insist on swapping -- take a look at novack (
https://www.novak-adapt.com/ ) and check out their "research" tab. They are the best resource for XJ motor swaps, and sell every adapter you'll need for the swap.\
Edit-- by the way, here's what novack says about 5.2/5.9 swaps -- (setting aside the fact that they are dramatically underpowered compared to a modern zz6/ls motor):
Jeep Engine Swap Comparison
We get asked occasionally what our opinions are of the Mopar V8 swaps into Jeeps. Some individuals think they must be easier since Jeep is now a Chrysler company. The swaps are not as intuitive as this would suggest, and on a whole, it is usually going to be easier and more economical to install a GM V8.
318 and 360 swaps into Jeeps are not as well documented as Chevy and Ford V8 swaps, the interest and momentum is rising and a body of knowledge is deepening on the subject. These good engines and worthy of consideration if you have one of these engines on hand. The installer should keep in mind that these engines, while affordable, do generally cost more to install and to work on than the Small Block Chevy and Ford counterparts. For those who understand and are comfortable with these good motors, this is usually not a significant setback.