XBee setup

Hello everyone, I would like to configure two XBee PRO 868 modules in order to make them replace a simple UART link. When I connect the Serial3 ports of two arduino mega2560 with wires, it works fine but when I plug a XBee module to send it "+++", it simply replies "+++" and sometimes some strange characters. This is my code :

#define debug Serial
#define uart Serial3

char ret;

void setup() 
{
   uart.begin(9600);
   debug.begin(115200);
   debug.println("setup");
   delay(1000);
   uart.print("+++");
   delay(1000);
   while(ret != '\r')//wait for "OK\r"
   {
      if (uart.available() > 0) 
      {
         ret = uart.read();
         debug.println(ret);
      }
   }
   debug.println("done");
}

void loop() 
{
   
}

This code comes from http://jeromeabel.net/ressources/xbee-arduino (in french). I also tried with a 3.3V ftdi cable (I don't have the XBee explorer board) with X-CTU, it didn't work. Did someone has the same issue or an idea ? Thank you, Mickael

Fixed but I don't really know why. I soldered directly wires from the arduino board to the XBee and I finnaly got "OK".