We had purchased an OBDII code reader for about $60-70 (don't remeber the exact price) when we purchaesd our BMW three years ago, and has more than paid for itself. It fits in a slot under the left knee area of the driver's seat to the right of the trunk release of the XF (you might have to twist a bit to fit).
It runs through a list and will flash either one or a series of codes (the less, IMHO, the better), and - at least the one that we use - will erase the codes once the codes flash across the reader after 5 times.
There are a few decent sites online that will list the codes as well as some links to how to repair the problem (we use
www.obd-codes.com/trouble_codes)
That being said, I still checked the code to be sure it was not a precursor to something that could become serious; if I continue to get the same codes (I got P0456), then I will need to look at either replacing the gas cap, or checking out the rest of the fuel system.