I was told from anothers who have done it, it is cheaper and easier just to buy a YJ with the motor and trans already in it. Then swap your lift and such over from your 4 banger YJ. Heck it might even be cheaper to fix the XJ. You'd be surprised how rotted the underside can be before it's beyond repair. My passenger seat was practically held in by carpet and a prayer and I fixed mine for the most part. I pretty much had no choice on mine though, it was my second car and I had it just over a year before I looked under it (I was young and didn't know any better). But I still owed money on it and the people who sold it to me (Apple) wouldn't do anything so I was stuck.
On a side note, I probably wouldn't buy from them ever again. say this because what happened with my Jeep and I worked at one of their dealerships for 2 years. Some shady stuff passes through their shops.