I had to replace three of the four lock/latch mechanisms on my '98. May be the same problem with yours. I'm not certain but I think the lock solenoid attachment to the actuator may be plastic that just breaks internally. Pulled the three out of my wrecked spare parts car and grabbed another half dozen when I was at the junkyard. Pull a panel, remove the rods, and remove the three bolts that hold on one of the mechanisms. Fire the lock button and you'll probably hear the solenoid fire but see no movement on the actuator.
1998 XJ Classic driver
1998 XJ Sport spare parts supply