Arduino xbee???

I have an arduino with xbee shield and xbee(1) radio in my room(A). I put a xbee(2) radio in room(B) to read the state of a switch on xbee(2) radio pin AD0/DIO0. While monitoring xbee(2) from my arduino in room(A), if AD0/DIO0 goes low on xbee(2) I want my arduino to receive this data and send a command out to drive AD1/DIO1 high on xbee(2) to turn on a transistor. But I am not sure how to do this? Please help. I think I have to send the AT commands out in their hex form, is this correct and I am not sure how or what the commands are. Looking for help with arduino code??

Have you seen:

It may answer your questions.