Sending info through xbee

Hello,

I am trying to send serial data from arduino to xbee and then send to another xbee wirelessly in AT Mode. However, can not receive or see the data on X-CTU on the recceivers end. For some reason the data is not being written on the transmit xbee. Here is the code.

#include <Keypad.h>
#include <SoftwareSerial.h>
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'#','0','*','D'}
};
byte rowPins[ROWS] = {11, 10, 9, 8}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

SoftwareSerial XBee(2,3);

char letter[5];
int i = 0;
int text[5];
  
void setup(){
  XBee.begin(9600);
}

void loop()
{
  char key = keypad.getKey();
  if(XBee.available())
  {
    for (i = 0; i <= 5; i+ i + 1) 
    {
    if (key != NO_KEY)
      {
      letter[i] = key;
      }
    }
   text[5]= letter[5];
   XBee.write(text[5]);
  } 
}