That's a pretty basic setup to achieve.
The xbee's pretty much take the place of wires between the 2 arduinos - Rx to Tx, Tx to Rx -
so you can send simple messages:
Tx side:
void loop(){
if (digitalRead(button1) == LOW){ // button connects to Gnd when pressed, with internal pullup enabled
Serial.print('1');
}
else {
Serial.print ('0');
}
delay (100); // forces read no more than 10 times a second for initial testing
// replace with blink without delay style reading every 100mS
} // end button read
} // end loop
Rx side:
void loop(){
If (Serial.available()>0){
incomingByte = Serial.read();
if (incomingByte == '1'){
digitalWrite (ledPin, HIGH); // assumes output drives anode high thru current limit resistor
}
else {
digitalWrite (ledPin, LOW); // must have been '0' that came in
}
} // end serial check
} // end loop