Just to make sure you don't have trouble again, you may wnat to check the part number on your belt. Problem is, most XJ belts I've seen have six ribs, not four or five - and you'll want to be certain of that before you go too far.
For 87-90XJ, you'll have a Delco alternator and pretty much any six-rib GM pully will work fine (they're a pretty standard size in production - I just don't recall the pully OD offhand.) For later XJ (Mitsubishi alt? Don't remember, and don't have one handy...) it's probably going to be a six-rib MOPAR pully. The difference is probably the diameter of the shaft it mounts on - but I could be wrong.
Either way, check the belt first - look for "K-some number." K4 is a four-rib, K5 has five ribs, and K6 is the six-rib I'd expect to see. The rest of the number gives the length of the belt - I could probably tell you what that is if you post the number (they're not that hard to read - just need a little practise. Even decoding the V-belt part numbers isn't that hard - there's a two-didig that's usually between 11 and 21 (the belt top width) and a three digit that gives the belt length (typically to within a half-inch.))
There are times when all that time I wasted behind the parts counter comes in handy...
5-90