Thermostats for an Nissan Xterra should be replaced, not repaired. The components are damaged by constant heating and cooling. Replacing individual components will result in a breakdown of the whole unit, which will require a replacement of the entire thermostat.
Release excess pressure in the radiator by opening the cap. Place a container under the radiator and let the coolant drain. Remove the cooling fan and belt from the vehicle to reach the thermostat housing. Take out the radiator hose and remove the thermostat housing while making a note of how it is positioned. Remove the old thermostat from the mount.
Scrape any glue or gasket parts from the mounting location. Spread a small amount of gasket sealant to the mount and place the new gasket securely in the mount area. Cover the new gasket with a scant layer of sealant. Place the new thermostat in the mount, replace the housing and position the bolts in their respective holes. Securely apply the radiator hose back to the housing.
Reinstall the drive belt, followed by the cooling fan. The drain valve on the radiator should be shut. Fill the radiator with fresh coolant. Screw the radiator cap back on. Wait for 45 minutes, and start the car. Check to make sure there are no leaks.