[repeat theme] [if theme_numlayers = "0"] [else] [end] [repeat group] [if group_theme_id = theme_id] [if group_visible = "true"] [if group_numlayers = "0"] [else] [end] [end] [end] [end] [end]
[repeat selection] [if selection_selected = "true"] [else] [end] [end]
[selection_name][selection_name]
[theme_name][theme_input] [theme_name]
  [group_name][group_input] [group_name]