Thanks for the reply. I found out that for the setup that I have got(Multitech Mdot. Arduino Leonardo and the xbee sheild), I can use the following code
if (Serial.available()) Serial1.write(Serial.read());
if (Serial1.available()) Serial.write(Serial1.read());
and send the following AT commands to get started.
but I am not very sure how I send these commands to the Arduino, I've tried entering them on the serial monitor. but nothing happens. Is there anything That I need to change in the above Arduino sketch? Or is there any other way to send the AT commands to the arduino leonardo?