XBee API tutorials for Arduino?

Assume you have S2 XBees?

Get Andrew Rapp's XBee library, GitHub - andrewrapp/xbee-arduino: Arduino library for communicating with XBee radios in API mode

Here is some code to show the very basics, not meant to do anything useful, but just to show how to use some of the classes and get you barking up the right trees.

#include <XBee.h>

XBee xbee = XBee();                    //instantiate the XBee object
ZBRxResponse zbRX = ZBRxResponse();    //XBee RX packet
byte dataLen;
XBeeAddress64 senderAddr;

void setup(void)
{
    xbee.begin(115200);                  //also does Serial.begin()
}

void loop(void)
{
    xbee.readPacket();
    if (xbee.getResponse().isAvailable()) {
        switch (xbee.getResponse().getApiId()) {             //what kind of packet was received
            case ZB_RX_RESPONSE:                             //rx data packet
                xbee.getResponse().getZBRxResponse(zbRX);    //get the received data
                switch (zbRX.getOption()) {
                    case ZB_PACKET_ACKNOWLEDGED:
                        dataLen = zbRX.getDataLength();
                        senderAddr = zbRX.getRemoteAddress64();
                        break;
                }
                break;
        }
    }
}