WARNING: This page is about a different car, the 2006 Nissan Xterra. However, it is still accessible from the selected car via links, so may be relevant.
Installation is in the reverse order of removal.
Fig 1: Disconnecting Accelerator Position Sensor Electrical Connector