I'm sure that Ghost is gonna jump me but here is my $.02 worth.
The 2.5l can be made to wheel and drive quite well. Plan on a cam, bore, haders and you'll have to upgrade the carb to a Holley or refit it with a later model tbi. If you want to put in a 4.0 and have the time and resources then go for it. You will have to swap out the front end and bang up the firewall. Its a great project. If you have less time/resources then buy an XJ with the 4.0l and start from there.
You do have the AX-5 which does not bolt up to the 4.0l and requires about $1000 of adapting, money better spent on the rest of your rig.
I guess if you already have a donor engine & tranny then its a good economical swap. If not then it requires either a lot of money or a lot of time in the junkyard scrounging parts. Either way is mucho fun.