The rear u-joint should be a 1310 series joint on all XJ's, but driveshaft lengths vary depending on the rear axle, the transfercase, and the transmission. What you have to do in this situation is take a measurement from the rubber seal at the back of the t-case to where the center of the u-joint cap would be. This has to be an accurate measurement. Ballparking it won't do. Take it several times. It should be within 1/8th inch on repeat measurements. Give this to a junkyard, or better yet to a driveline shop. May as well price a new shaft, instead of buying a JY one and then replacing joints in a month.
Any used shaft will show signs of wear on the transmission slip yoke from where the rubber seal was sitting it. When installed, the transmission slip should push in far enough so that the rubber lip on the tranny sits 3/4" to 1 inch from bottoming out on the slip.
If there is a Jeep junkyard in your area, they should be able to find you something from a jeep that has the same build configuration as yours.
BTW, did you move the Jeep or attempt to with the driveshaft out? You may have lost some ATF if you did.
Geoff