Your code looks like crap. Use Tools + Auto Format to properly indent the code.
}char B = XBEE.read();
Bullshit. NOTHING goes on the line after a }. EVER!
Commented out code is NOT part of the problem. DELETE IT!
Read and store the "command" character. DO NOT COMPARE WHAT YOU HAVE JUST READ TO 'A'. When you do this, and it isn't a match, you read again, and see if that is a 'B'. What if the character read the first time was a 'B'? That is not an 'A', so you should check to see if it is a 'B'. But, you can't, because you've already thrown it away.
You never use the value in B, so that statement is useless. More than that, it is wrong.