I have a number of optional sections in my form that are, by default, not included in the form's data structure until the user checks a checkbox and the section is included using thisXDocument.View.ExecuteAction( xOptional::insert, <xPath> ). When the user unchecks the checkbox, the group is removed using xOptional::remove.
Note: I'm ...