Funny you should mention this kind of technology, my dohickey project
(python/gtk) employs automatic field branching all data is stored as
xml too, which is quite unique and it may be something you can use the
ideas from.
The premise is simple: Not all fields are available to fill in.
Instead some fields only become available when either boolian
(checkboxes) or lists (dropdowns) have specific values, causing the
appearance of more values. each further set of child fields has the
same functionality as the parents and all data derived from the
structure is passed along as a flat hash/dictionary.
Do I make sense?