The question requires knowledge of how you offroad. Please specify what type of terrain, and most importantly, do you mean with both vehicles stock, or with some measure of modifications?
I will tell you a few general things that are relevant to offroading:
1) The WJ is a solid front axle, while the XK is independent. You can fill volumes with pros/cons, but the rarely contested ones are that solid axles accept more offroad abuse, while IFS drives smoother and straighter (the caveats to both those statements can fill books).
2) In stock form, the electronics package of the XK is likely to do less slipping than the WJ. I'm very impressed with QD2, which is an option for the XK (I have it on my WK).
3) The XK is probably going to have a lot more power, albeit with more weight to carry. In some offroad situations, horsepower has no substitute. In others, lighter weight is very important.
4) I think you'll find the XK is much more top heavy than the WJ. I don't have any data to back up my theory, but having seen both in off-camber situations, the commander looked like a few more pounds on the roof would have rolled it, while the WJ wasn't even considering it.
5) Modifications for the WJ are prolific and inexpensive. Modifications for the XK are the opposite. You will find there are many offroad accessories that simply aren't offered for a WK or a XK.
6) The WJ has a frame, and clearly doesn't need the doors and hatch to keep the structure sound. Lots of chopping options there. The XK, I'm not sure of, but I'm assuming it's designed like the WK, which integrates the body and frame to save weight and add stiffness.
Better offroading? Well, if you want to drive smoothly over rough roads at higher speeds, the XK should do better. If you want to wedge 37" tires under it and go rock crawling, the WJ gets my vote. Neither vote has much certainty tied to it.