Yes, it will bolt in and work, assuming it's the correct gear ratio.
One thing to consider is that most XJ front axles are high pinion, while the TJ front axle is low pinion. The LP axle will work but the gearset runs on the weaker side of the gear, and your pinion and driveshaft is lower to the ground (in harms way).