> Are you using the Python library? I think ruby gets this right, as it is > guaranteed that "Hashes enumerate their values in the order that the > corresponding keys were inserted.". Probably not true for Python. Maybe using collections.OrderedDict to define your tree helps. Regards Martin