After you loosen the gas cap, you can place it in the holder on the inside of the fuel door while you fill up. Once you’re finished, make sure you tighten the gas cap until it clicks once, then firmly shut the fuel door.
It’s important that both the gas cap and fuel door are always closed properly. When the gas cap is loose, dirt particles can enter your Xterra’s gas tank while also letting gas vapors out.