A router will do that automatically. That is you do not need an external processor to perform that function. That is something that is part of the XBee's firmware and is controlled by the DL and DH fields of the XBee and the TX request packet for the modules that are in API mode.