Can't tell if you have an auto or a manual transmission, but if it's a manual there's a TSB that sounds like it's the answer:
Service Bulletin Number: NTB00007
Bulletin Sequence Number: 995
Date of Bulletin: 2000/01
NHTSA Item Number: SB609976
Make: NISSAN TRUCK Model: XTERRA Year: 2000
Component: FUEL:FUEL INJECTION:IDLE SPEED CONTROL UNIT
Summary: SOME VEHICLES MAY EXHIBIT AN IDLE FLUCTUATION WHEN COASTING TO A STOP WITH THE CLUTCH DEPRESSED AND THE TRANSMISSION IN GEAR.
Hit your service dept. with that TSB number when you take it in.
Brent