You need to read the tire label on the driver's door, if the ink is still there. My 88 XJ Pioneer, 4.0, AW4, NP231 came with P205/75R15 tires. The stock speedo gear was 35 tooth.
When I went to LT235/75R15 tires I had to change the speedo gear to a 33 tooth. There was a TSB issued which told what gear to use for each tire/gear combination.
What I recall for a 215/75R15 tire you use a 34 tooth gear,
For the 225/75R15 or the 235/75R15 you use a 33 tooth gear.
If the gear is orange is is a 35 tooth. I don't recall the colors for the other tooth counts, the gears are colored to help easily ID the tooth count. You need to crawl under your XJ, remove the speedo cable from the transfer case, then remove the bolt holding the speedo gear quil into transfercase. remove the gear and note the color.
Also look at the quil before you remove, it can only go in 4 ways. Notice the arrow on the case and how it is lined up with the quil. If you don't install it correctly you won't have any indication of speed. Also be careful to get the speedo cable back into the speedo gear shaft.
What size tires do you have and are you planning on changing? Do you have a speedo or odometer error?