Hi,
On Arduino mega you can also use software serial port.
Not all pins on the Mega 2560 support change interrupts.
In this case, please disconnect all the jumper hats of XBEE shield, use two jumper wires connecting XBEE_TX and XBEE_RX to D10&D11.
Then modify the demo to SoftwareSerial XBee(10, 11); // RX, TX
See whether this works. Thanks!