in reply to Data structure advice needed

I think it might be worth pointing out that the XML you provided is not realy a good layout. Perhaps you get it from somwhere else but I would consider it a main problem.

Since the order of elements in XML should not be a factor in there display, picture that code with the lines out of order and you'll see there is no relation (XML wise) between some of your attributes. This does not mean of course that you can't use that layout, just remember that it should be considered a modified subset of XML and that some Parsers may parse it correctly while others may not.

<default-id>0x654321</default-id> <default-id>0x123456</default-id> <attr-name>security_string</attr-name> <attr-name>model_name</attr-name> <alternate> <mtype>0x234567</mtype> <attr-id>0x654321</attr-id> </alternate> <alternate> <mtype></mtype> <attr-id></attr-id> </alternate>

You can see all the same data is there but now its lacking meaning, and that parses as the same XML as above. A solution might be to wrap each element inside another tag.

<attr name="model_name"> <alternate> <mtype>0x234567</mtype> <attr-id>0x654321</attr-id> </alternate> <default-id>0x654321</default-id> </attr> <attr name="security_string"> <alternate> <mtype></mtype> <attr-id></attr-id> </alternate> <default-id>0x123456</default-id> </attr>

___________
Eric Hodges