PaulS:
Do you guys nows what's wrong with the code?
That code should be in setup(), or a function that gets called only as needed, not in loop().
The code talks to the XBee, but doesn't listen to the XBee. Why not?
The code isn't listening to xbee because this is only a prototype code, I'm using that just to learn how to use the AT commands in the source code. After I will do a complete code to my project
But thanks PaulS like always you helped me a lot.