a: No, the code is not already installed and running. Depending on which XBee module it is depends on what you need to do to make that work. For example, a cellular XBee can use Micro Python but in to create an I2C object, read that data and provide that data to the Cellular processor to be sent out over the air.
The older Programmable XBee modules use C that is installed on a secondary FreeScale processor. That C code creates the object and determines what to do with that data.
A standard XBee does not have that capability. It would need to be connected to a Processor that has a UART (Connection to the XBee) and an I2C master port.