Typically if you're pulling the factory radio you will want to get a stereo harness kit that will plug into the factory clips. You can then wire the new stereo to this wire harness. Something like this is what I think you're missing --
Compatible with Nissan Xterra 2000-2008 Factory Stereo to Aftermarket Radio Harness Adapter https://www.amazon.com/dp/B019HHODQS/ref=cm_sw_r_cp_apa_i_GIRHDb7RC8PCQ