Using arduino and xbee to achieve wireless control of solenoid valve

I am new to arduino, and I am doing this project which requires me to control solenoid valve through arduino and xbee wirelessly.

I did some read ups about Arduino, Xbee communication. However, I dont know how should I start programming this.

My set up will be,

Computer+Xbee+Xbee Explorer USB is one end.
Arduino+Xbee+Xbee Explorer regulated is the other end.

My intention will be, if I key in OPEN, and key in opening time like "1000", the valve will be open for 1000ms.

I am not sure if this is possible with arduino, if it is, can anyone give me a hint on how my code should roughly be?

I am not sure if this is possible with arduino

It is.

can anyone give me a hint on how my code should roughly be?

Robin2 can: Serial Input Basics - updated - Introductory Tutorials - Arduino Forum