XJ = Late model year 1999 - 2001 (End of production)
WJ = Late model year 1999 - 2004
TJ = 2000 - 2006
However I would highly advise on avoiding LMY99-02 4L's. I've posted this in many a thread; the first iteration of the 0331 head was prone to cracking due to a copper deficiency that was corrected in 03. This isn't to say that EVERY 99-02 will crack, but the possibility is higher in these years. Its just something you ought to avoid. You'd be best served looking for an 03-06, though i hear there are problems with 04-05's, something to be aware of as well.
Dead giveaway on the motor being the correct one would obviously be the coil bosses on the passenger side of the head, and the horseshoe shaped intake manifold.