You are sending an API packet while in command mode which will not work.
There are different modes the xbee radio can be in. In transparent mode the radio sends everything received from the UART out transparently unless you wait one second send three + characters "+++" and then wait one second. this puts the radio into command mode. In command mode you send AT commands with just ASCII characters. for example in command mode you could send ATBD7 to change the baud rate to 115200 you might then send ATWR to write the setting to non-volatile memory and then enter ATCN to exit command mode and go back to transparent mode (or you could wait for the 10 second timeout.) These AT commands are ASCII strings.
If your radio is instead in API mode (AP = 1 or ATAP1) then all commands would be sent with API frames. Transmission requests, AT commands, and other types of request can be sent in this mode. To send an API command for that same ATBD7 we mentioned earlier you would send: "7E 00 05 08 01 42 44 07 69"
"7E" is the API header, "00 05" is the packet length, "08" is the packet type for AT command, "01" is the frame id which can be anything and lets you match this request with the response the module will give you, "42 44" is ASCII for BD which is the command we are sending, "07" is the value we are setting BD to representing 115200 baud, and 69 is the check-sum (FF minus the sum of the other bytes between the length and check-sum fields.) Remember all of these are hexadecimal bytes. You should also use API commands to send your data when in API mode.