XBee + library + arduino = freezes

Here is the code I tried this morning:

void setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly: 
  byte buf[] = { 0x7E, 0x00, 0x10, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x30, 0x30, 0x93};
 for (int i = 0; i<20; i++){
  Serial.write(buf[i]);
 }
  delay (1000);
}

Still the same, 34 packets were sent only.