Is there any way to trace what is going on in the XBEE (S2) for troubleshooting purposes ?

Yes, obtain a Zigbee sniffer.