Problem AT commands mode, XBee series1, Wireless SD shield

I’m trying to configure the Xbee module from code running on the Arduino board.
(Please see http://www.arduino.cc/en/Guide/ArduinoWirelessShield , Configuring the Xbee Module)

Here are my components
-Arduino Leonardo
-XBee series1 (802.15.4)
-Wireless SD shield (http://www.arduino.cc/en/Main/ArduinoWirelessShield)

Basically, I did exactly as this site suggested Google Code Archive - Long-term storage for Google Code Project Hosting.

The only difference is that I added

while (!Serial) ;

into void setup() because I’m using Leonardo (one site told me to do this but I couldn’t find that link).

Here’s the code that I’m using.

void setup()
{
  Serial.begin(9600);
  while (!Serial) ; // wait for serial port to connect. Needed for Leonardo only
}

void loop()
{  
  Serial.println("------------------");
  delay(1200);
  Serial.print("+++");
  delay(1200);
  bool bOK = false;
  while (Serial.available() > 0) {
    Serial.write(Serial.read());
     bOK = true;
  }
  
  if(bOK)
  {
    Serial.println();
    Serial.println("ATMY");
    delay(100);
    while (Serial.available() > 0) {
      Serial.write(Serial.read());   
    }
    Serial.println();
    Serial.println("ATCN");
    delay(100);
    while (Serial.available() > 0) {
    Serial.write(Serial.read());
    }
    Serial.println();
  }
  
  Serial.println();
}

I suppose to get ‘OK’ back in the serial monitor but all I got is just ‘+++’
I feel like there’s something fundamentally wrong but I’m not sure what that is.
Any helps or guides will be very much appreciated.

Thanks in advance.

Ps. See attachment for my serial monitor.

Useful links