What year Xterra? I would just reprogram it and see if works or not? Easy to do if other stuff is failing:
*Have all fobs you want programed*
1. Close and lock all doors with the driver's side power lock / unlock switch located
on drivers door panel.
2. Insert key into ignition and remove it from the ignition key cylinder at least 6 times
within 10 seconds. Your hazard lamps will flash if you have performed this step
successfully. NOTE: Withdraw key completely from ignition cylinder each time. If
this procedure is performed to fast, system will not enter programming mode.
3. Insert key into ignition and turn to the ACC position.
4. Within 5 seconds, push ANY button oon the keyless remote. Your hazard lamps
will flash. NOTE: Do not press the button on the remote more than one time or the
programming will not be successful.
5. If there are any remaining remotes (including old ones), Unlock then Lock all doors
using switch on drivers door panel and within 5 seconds press ANY button on the next
remote. Your hazard lamps will flash. Repeat this step for each remote (including any
existing remotes).
6. Turn key to the off position, remove key from the ignition. Unlock door using switch on
door panel and open drivers door.
7. Test remote(s).
Or 2nd gen:
Programming Instructions
IMPORTANT: Before entering programming mode, have in possession all of the transmitters
you will be using on the vehicle. Once you program the transmitter, all previous codes will
be erased from the memory. The other transmitters will not be functional until you program
the transmitters again.
1. Close and lock all doors with the driver’s side power lock/unlock switch.
2. Insert key into ignition and remove it from the ignition key cylinder at least six times
within 10 seconds. Your Hazard Lamps will flash if you have performed this step
successfully. NOTE: Withdraw key completely from ignition cylinder each time. If this
procedure is performed too fast, system will not enter programming mode.
3. Insert key into the ignition cylinder and turn to the ACC position.
4. Within 5 seconds, push ANY button on the remote transmitter. Your Hazard Lamps should
flash. NOTE: Do not press the button more than one time in the above step. If the button
is pressed more than one time, the programming procedure will not be successful.
5. If there are any remaining transmitters (including the old ones), unlock then lock all doors
using the driver’s side power lock/unlock switch and within 5 seconds, push ANY button
on the next remote. Your Hazard Lamps should flash. Repeat this step for each
transmitter (including any existing transmitters).
6. Turn the key to the OFF position, remove keys from the ignition, unlock doors using the
driver’s side power lock/unlock switch and open the driver side door.
SOURCE:
http://www.programyourremote.com