How best to detect missing/lost packets in XBee S2 communications
This answer is aimed at the detection of data corruption at a level above where the Xbee works i.e. at the so-called data link layer. Xbee is presumed to handle the "physical layer" in this answer. See wiki if this is confusing: -



If you want to measure the deterioration in quality of data received (before retry mechanisms try to correct it) then you'd probably be wise to consider setting a yardstick transmission of a known length. Transmit this periodically at a known rate and when the receiver acquires and recognizes the yardstick transmission it counts a number called A. 

A is the "good" count.

If the message is received but corrupted (error detection codes recognize corruption) maybe count a number called B. Finally, to check the effectiveness of your error detection method, count a number C. C is for all transmissions that got thru the error detection system but, didn't have exactly the correct message in the payload - you can do this because your receiver can know the yardstick message.

B is messages thrown out due to detecting errors and C is messages that would get thru in error.

Leave the system running for a few minutes and look at the data. A+B+C should equal the number of transmissions sent but if they don't this also indicates that there is a weak link between sender and receiver.