The complexity of your chosen task aside, your data structure looks good at first glance, but, in my opinion, there are two or three things wrong:
- , -,
- stdribute . .
- ( node .)
, xml node. , XML:
<dinner time="19:00" dresscode="informal">
<course id="starter">
<food>Consomme</food>
<food>Tomato soup</food>
<course>
<course id="salad" optional=optional>
<food>Green salad</food>
<course>
<course id="main">
<food>Steak and kidney pie</food>
<food type=vegetarian>Spinach lasagna</food>
<course>
<course id="dessert">
<food>Fruit</food>
<food>Ice cream</food>
<food>Coffee</food>
<course>
</dinner>
food course s, , course . . - , - .
, , . ( left, - right.) .
- , .
(, XML .)