Can the same Xbee function as an actuator and a sensor?

I want to use the same xbee to sense the analog voltage value and respond by actuating the circuit

If you are using Micro Python with an XBee 3, then I don’t see why not.