Unable to Serial.read() using XBee

Hi everyone.

I’m kinda stuck in a part of the code I’m doing. I am making a menu to work with different xbee.

#include <XBee.h>

int option;

void setup() {
   Serial.begin(9600);
   xbee.setSerial(Serial);

   Serial.print("- MENU -\n-------\n\n");
   Serial.print("1: Encontrar/Actualizar dispositivos\n");
   Serial.print("2: Encender dispositivo\n");
   Serial.print("3: Apagar dispositivo\n");
   Serial.print("Introduzca opcion: ");
}


void loop() {

  if(Serial.available()>0){
    option=Serial.read()-48;
    Serial.print(option);

    switch(option){
      case 1:
        Serial.print("\n\n-NODE DISCOVERY-\n\n");
        NodeDiscovery();
        break;

      case 2:
        
    }
  }   

  
}

The serial shows all the options availabe for the Menu, so I can select one of them. The problem is that when I want to read the option I typed in the Serial, it doesn’t work. I’m using an Arduino MEGA with a Wireless Proto Shield and one XBee S2, both mounted on the MEGA.

Using this configuration, the Serial.read() isn’t working. However, when I remove the XBee all works fine.

Does anyone know the problem of using Serial.read() and the XBee at the same time?