How to write Arduino Code for interfacing Xbee S2C with Arduino Nano using SPI?

I am not sure you can. The XBee is a SPI slave device. The arduino would have to be a SPI master running at the same 3V interface.