By default, the 1999 XJ uses an electrical speedo gear. The speedo gear is still mechanical but sends an electrical signal to the PCM.
If your speedometer is acting on the fritz, likely the VSS (Vehicle Speed Sensor) needs replacement.
JB SuperShort SYE
Uses an electrical tone ring with sensor found in the newer wranglers. Replacement sensor can be found at:
AutoZone Part # SU3344: www.autozone.com/autozone/parts/Duralast-Vehicle-Speed-Sensor/2005-Jeep-Wrangler-4WD/_/N-jmx89Z9gsum
Vehicle Speed Sensor Wiring Pins
L to R with Clip on Top:
3 Sensor Signal
1 5v supply