There isn’t a command to do this directly. You’d need some external circuitry.
If you have Vref connected directly to VCC (the common case) you could for example connect a resistor and zener in series: resistor to VCC, resistor/zener to an anlog input, zener to ground. The zener voltage would remain constant, so you’d be measuring the ratio between that and the supply voltage as the supply voltage decreases.
Doing that just as described would obviously create an extra battery drain. So a transistor in series with the zener, driven from an output line, would enable you to turn the arrangement on for the measurement and then off again.
To make this work, you’d obviously need to arrange to send the necessary commands to the XBee to control the output line and take the reading.
That’s my best shot. Maybe someone can come up with something a bit more elegant?
Assuming the original poster is using Series 1 XBees (this being the 802.15.4 forum) I’m afraid that won’t work because the %V command exists only on series 2 XBees. The series 2 XBees have an internal voltage reference, whereas the series 1 models don’t. That’s why there has to be some external circuitry if battery voltage is to be measured.
I did try this out: if I send the %V command as AT%V the response is ‘ERROR’. If I send the command as an API packet, the response has ‘Invalid command’ status.