XBEE s1 configuration without using X-CTU in API mode using arduino

I would like to configure Xbee modules without using X-CTU . I want to configure using arduino in API mode .

I want to scan for available PAN ID's and then join in my preffered network and set other details such as "MY" address , Destination address , channel over the air without x-ctu .

Is it possible to do it . ? Please help !!

Is it possible to do it . ?

Let's start with how you intend to scan for available PAN IDs. Do you intend to change the setting for PAN ID, using an AT command, and then hope that when you exit AT mode, the XBee joins a network?

How will you know that it did?

Is it possible to scan for all the available PAN ID's just like a phone displays all the available WIFI SSID's ?

My intention is to join a new end node without using X-CTU just by using program .

It has to first scan for already available PAN IDs(networks) , then join a network (user selected) and then communicate with coordinator / router .