Hey Pat!
There's a few procedures to be followed after changing out the ignition - I'll see if I can get them right, but in case I don't, please refer to the FSM for your year of Xterra (which we provide to you here:
www.nissanservicemanual.com)
The method for throttle and idle learning can be found in the Service Manual, as well as the ECU reset procedure.
ECU Resetting:
1. Ignition "ON", count to 3.
2. Depress/Release pedal 5 times...hard and fast.
3. Count to 10 (not 7!) and fully depress pedal
4. Count to 12 (SES should be blinking), release pedal
5. Count to 10, depress pedal
6. Count to 10, release pedal.
7. Turn off ignition, then start engine.
SWITCH DIAGNOSTIC TEST MODE
NOTE:
It is better to count the time accurately with a watch!
It is impossible to switch the diagnostic mode when an accelerator pedal position sensor circuit has a malfunction.
Always ECM returns to Diagnostic Test Mode I after ignition switch is turned OFF.
How to Set Diagnostic Test Mode II (Self-diagnostic Results)
1. Confirm that accelerator pedal is fully released, turn ignition switch ON and wait 3 seconds.
2. Repeat the following procedure quickly five times within 5 seconds.
a. Fully depress the accelerator pedal.
b. Fully release the accelerator pedal.
3. Wait 7 seconds, fully depress the accelerator pedal and keep it for approx. 10 seconds until the MIL starts blinking.
NOTE: Do not release the accelerator pedal for 10 seconds if MIL start blinking on the halfway of this 10 seconds. This blinking is displaying SRT status and is continued for another 10 seconds. For the details, refer to "How to Set SRT Code" in the FSM.
4. Fully release the accelerator pedal.
ECM has entered to Diagnostic Test Mode II (Self-diagnostic results).
How to Erase Diagnostic Test Mode II (Self-diagnostic Results)
1. Set ECM in Diagnostic Test Mode II (Self-diagnostic results).
2. Fully depress the accelerator pedal and keep it for more than 10 seconds. The emission-related diagnostic information has been erased from the backup memory in the ECM.
3. Fully release the accelerator pedal, and confirm the DTC 0000 is displayed.
To clear the computer "memory" you need to run the engine a few seconds with the MAF disconnected, which will trip a code. Clear that code, and the memory will be erased as well.