Likely related to a bad fan clutch. $35 from any auto parts store. You can also confirm this as the xterra my overheat when idling.
open