This might not what you are looking for (break a butterfly on a wheel) but when i hear
I almost directly think about a nice TCP Protocol (had to Programm some Server an Client Applications
, only not for Arduino). I know in the Arduino Wi-Fi Shield they use TCP. le Link to the Library:https://github.com/arduino/wifishield/tree/master/libraries/WiFi/utility
socket, server_drv and spi_drv could be of interest for you to implement TCP. In the parent folders you should find examples on how to send and receive data using TCP. I think you would almost only have to change the spi_drv funktions to insteed talk to your XRF modul.