Digi Xbee hub with Arduino

So I am going to try and build my own custom hub that has built in Ethernet/Wifi and can receive packets from a XBee "Coordinator" that is plugged into it.

My question is this.... If lets say I have 20 end nodes all talking to the 1 Coordinator, I am constantly receiving data on the Arduino side, how could I package all that information and send it to a web service in JSON format? How would I store and cycle through all the different nodes and push status's of all the IO's?

how could I package all that information and send it to a web service in JSON format?

What information? Why JSON?

How would I store and cycle through all the different nodes and push status's of all the IO's?

What are the XBees sending? How do you know which is sending?

JSON is easier to inject into MongoDB.

XBees are just sending status of sensors, Door open, door close, temp, light, humidity, XYZ position, IR, and you know which one is which by the MAC address for each one. Each one is also labeled with a name descriptor you can set in the X-CTU software.