The 4.0 has everything you need,
Horsepower and EFI, what ever the angle it will run and pull you through.
An alternative is to mount the head and manifolds from a 4.0 onto a 4.2 and run it. I think some coolant ports need to be blocked but other than that it's a bolt together.
If your going to use the auto from the 4.2 wrangler you'll need a crankshaft position sensor relocator. It puts it on the front of the crank. A little googleing should find one.
As for fitting the accessories. Measure the width on your engine bay where your accessories mount to the front of the engine and measure the width on the cherokee. I suspect yours will be wider. They probably mounted the yj's differently since they had more room.