Just one idea for your consideration...
For my project I needed some way to keep and manage arbitrary order of objects in a hash-element, which is reflected
in the order as the objects appear in the XML. I did a very straightforward hack to the code, which you won't like,
but I enclose it for illustration. It takes care of the order when reading/writing hashes of object nodes, in case the
objects have attribute accessor called "_xml_position" (being a plain integer) defined. Maybe the capability
and the name of the attribute should be rather configurable? |