its actually really easy to put one a cherokee. If all we care about is getting it in there, all you need is a transmisssion AX15 or AW4 with a 23spl output and a big ass hammer to smash up the floor where the new case will sit flush (for your clocking ring)
But as you should be aware, in stock form you'll no longer have 4x4 because the D300 is a pass side drop t-case. If you want to put it in your XJ you'll either need to flip the t-case, or put in a new pass side drop axle. Your choice but I'd go the way of the axle first. I plan on putting a flipped 300 in my XJ when i get the new motor/tranny combo. (right now i have an early AW4 with the 21 spline output.)
With a 4.0L also consider that if the pumpkin is on the passenger side you're going to end up with a driveshaft trying to occupy the same space as an exhaust downpipe.