Connect 2 Xbee with 1 Arduino

Hello everyone.. i need a help
I have two Xbee
let me put some analogie,

First Xbee is called Xbee A
Second Xbee is called Xbee B

They are going to be connected with an arduino

I make code on arduino like this

void setup(){
Serial.begin(9600);
Serial2.begin(9600);
}

Void loop (){
Serial.println("1")
Serial2.println("2")
}

Form that source code, just Serial.begin can be excuted,,, whereas Serial2.begin couldnt be executed,,
please help for this..

whereas Serial2.begin couldnt be executed,,

Nonsense. The code could be executed, IF you have a Serial2 instance. The code would actually accomplish something IF you had anything connected to the RX2 and TX2 pins.

You FAILed to tell us which Arduino you have, or what pins the XBees are connected to.

please help for this

Without anywhere near enough information? Not a chance.