Write string to SD card and send string via xbee

When the xbee is connected, the write to SD card ability is lost.

I find that incredibly hard to believe. Unless the process for connecting the XBee is not what you have described.

Are you uncommenting the XBee code at the same time?

The usual reason for using the XBee library is to be able to receive messages from an XBee that is not connected to an Arduino and that has external sensors attached. Another reason is to set up bi-directional communication between two series 2 XBees that do not need to involve the coordinator.

Neither scenario applies to you, does it?

Since the XBee is connected to the Serial pins, just use Serial to send data, without using the XBee library. Forget about whether or not the receiver is able to understand the data. I just want to know if the physical attachment of the shield with XBee mounted is what is causing the problem.

If so, then the next test would be to mount the shield without the XBee aboard, to see what that does.