Xbee doesn't seem to answer when shield is set to xbee

I’ve created a program to test an xbee from the moniter, but the xbee doesnt seem to respond when im using the monitor instead of the console on the x-ctu.

All works fine when im using the console on x-ctu. And i did change the jumpers from USB to Xbee when i tried to write to the xbee from the serial monitor.

#include <SoftwareSerial.h>
SoftwareSerial XBee(0, 1);

unsigned long startMillis = 0;
bool XbeeRead = false, SerialRead = false;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  XBee.begin(9600);
  Serial.println("loading");
  for(int i=0; i<20; i++) {
    Serial.write("-");
    delay(100);
  }
  Serial.println("\nloaded");
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee
    if(SerialRead == false) {
     SerialRead = true;
     Serial.println("\r");
     Serial.println("-----[Serial]-----\r");   
    }
      XBee.write(Serial.read());
  }
  else if(SerialRead == true) {
    SerialRead = false;
    Serial.println("\r");
    Serial.println("----[SerialEnd]---\r"); 
  }
  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    if(XbeeRead == false) {
      XbeeRead = true;
      Serial.println("\r");
      Serial.println("------[Xbee]------\r");   
    }
    Serial.write(XBee.read());
  }
  else if(XbeeRead == true) {
    XbeeRead = false;
    Serial.println("\r");
    Serial.println("-----[XbeeEnd]----\r"); 
  }
  if(millis() - startMillis >= 5000) { XBee.write("+++"); startMillis = millis(); }
}

Did update the firmware

SoftwareSerial XBee(0, 1);

unsigned long startMillis = 0; bool XbeeRead = false, SerialRead = false;

void setup() { // put your setup code here, to run once: Serial.begin(9600);

You can NOT do hardware serial and software serial on the same set of pins.