Since I am currently working at a Nissan Dealership locally I will first tell you to try to deal with fleet or internet sales if you can and if you want to see an invoice (fleet will show it to you). Second if you are thinking of keeping this vehicle for 4 years or less don't purchase extended warranties and all that other garbage they try to get you to buy in finance. Gap insurance is all you need if you aren't planning on keeping it past ~2009.
Invoice for a new S 4X4 manual is ~$21,700 (+ around $580 for destination charges)(MSRP will say about $22,300+ $580 destination) but that is with no other options really. Once you throw in options (like tow package, etc) and shipping and destination charges you are looking at more like $25,000. Invoice for an automatic is ~$22,4xx plus destination. MSRP on the window will be closer to $23,7XX plus the destination and all that automate, pinstripe shit charges they throw in you will probably be looking at $26,XXX.
As for the certified pre-owned it has some sort of warranty. But make sure they print you a carfax with it so you can see if there are any blemishes on the vehicles record. Xterras don't last long in the used car lots, at least not at the dealership I am working at but if you do find one make them meet
your final price. Don't tell them what you want your monthly payments to be, tell them what the final cost you want to be is. Just so they don't try to get you into a 7-8 year financing. Good Luck.
**EDIT: Also if you aren't busy Friday night at around 7pm stop buy Nissan of Scottsdale on McDowell and meet some Xterra owners and see their experiences at local places.
OH YEAH---Welcome