Congratulations on the new car! You can open the gas tank on a Cadillac XTS from 2017 by locating the fuel door on the rear passenger side of the vehicle, pressing it until the door pops open, and twisting the gas cap off.
To close it, simply twist the gas cap back on and press the fuel door closed. The gas cap helps control the XTS’s emissions, so it’s extremely important to make sure it is securely fastened. When the gas cap isn’t put back on correctly, amassed fuel vapor will likely escape from the XTS on startup and the Check Engine light will illuminate.