atemega328 + ftdi +zigbee s2

I use an atmega328 with fdti cable wired at rx/tx and i want to connect a zigbee s2 at diferrent pins. I have tried to use SoftwareSerial library but i would like to use the xbee library too. Is there a way to use both libraries? If there is no way doing this, is it a problem to connect both fdti cable and zigbee at the same rx/tx? In the future, in opposition to fdti cable i will use a micro usb avr

Is there a way to use both libraries?

The XBee library needs to be told which instance of the Stream class to use. That can be any class derived from Stream, such as HardwareSerial or SoftwareSerial.

So, yes.

SoftwareSerial mySerial(10, 11);

void setup(){

Serial.begin(9600);
mySerial.begin(9600);
xbee.begin(mySerial);

}

Something like this and then i can use xbee classes get.Response etc etc.?

Something like this and then i can use xbee classes get.Response etc etc.?

Yes.

Thanks!! I am asking that because i have wired both zigbee and ftdi to rx/tx pins and every time i want to upload my sketch i have to unplug first my tx/rx from zigbee because i get an error.So if i want to connect a permanent avr like usb and not ftdi i have to use SoftwareSerial and connect zigbee to another pins?