XBEE 868LP API mode communication with Particle Photon SPI mode

Hi to All,
I need some information about transmit sensor data from particle photon via SPI to xbee 868LP in API mode.
I have tried to use xbee library for arduino but isn’t simple to understand.
The big obstacle is the frame generator, is not clear how to compose.
Who can help me?
Thanks in advance,

Michele.

What Xbee library are you using? Have you looked at this one by @krvarma

Hi rama,
I don’t use serial port but SPI protocol to communicate with xbee.
I need a piece of code to generate frame like XCTU tool.
Best regards,

Michele.