best way to process data received via XBEE?

This code will read the serial port even if there aren't characters waiting to be read:

processData (){
char c = Serial.read ();   // RX0 reads the incoming data from XBEE

You need to wait for Serial.available() to be >0 (really, >= the number of characters you expect), before reading data from the serial port, or all you will get is the -1 that Serial.read() returns when there is no serial data waiting to be read.

Same for the Serial.read() below if (c == 'Y').

This might explain some of the funky behavior you're seeing.

-br

Edit: fix typo.