sensors

Vehicle Speed Sensors

By default, the 1999 XJ uses an electrical speedo gear.   The speedo gear is still mechanical but sends an electrical signal to the PCM.
Troubleshooting
If your speedometer is acting on the fritz, likely the VSS (Vehicle Speed Sensor) needs replacement.   
JB SuperShort SYE