XBee transparent mode with Alternate pins.

Okay, so with the following I get this error:

Sure, because you can't call the begin() method there. You need to call it in a function. The setup() function makes the most sense, because you only want to call begin() once.