I had to replace my fuel gauge in my 2001 Xterra, mine was a different problem but the issue was part of the same component. In mine the wire for the fuel temperature sensor broke.
Not sure for your 2007 model but in my 2001, the whole assembly is all part of one replaceable unit. It cost about 70$ to replace and thankfully in my model I did not have to drop the tank to get access as there is a port under the back seat.
Hopefully in your case it fixed itself but most car parts stores do code reading for free. I suggest 1. getting it read and posting the code, and 2. getting the code reset. That way if the light comes back on you will know it is still occurring.
Not sure for your 2007 model but in my 2001, the whole assembly is all part of one replaceable unit. It cost about 70$ to replace and thankfully in my model I did not have to drop the tank to get access as there is a port under the back seat.
Hopefully in your case it fixed itself but most car parts stores do code reading for free. I suggest 1. getting it read and posting the code, and 2. getting the code reset. That way if the light comes back on you will know it is still occurring.