def create_form_data(self, **kwargs):
        """Create groupings of form elements."""
        # Get the specified keyword arguments.
        children = kwargs.get('children', [])
        sort_order = kwargs.get('sort_order', None)
        solr_response = kwargs.get('solr_response', None)
        superuser = kwargs.get('superuser', False)
        # Get the vocabularies to pull the qualifiers from.
        vocabularies = self.get_vocabularies()
        # Loop through all UNTL elements in the Python object.
        for element in children:
            # Add children that are missing from the form.
            element.children = add_missing_children(
                element.contained_children,
                element.children,
            )
            # Add the form attribute to the element.
            element.add_form(
                vocabularies=vocabularies,
                qualifier=element.qualifier,
                content=element.content,
                superuser=superuser,
            )
            # Element can contain children.
            if element.form.has_children:
                # If the parent has a qualifier,
                # create a representative form element for the parent.
                if getattr(element.form, 'qualifier_name', False):
                    add_parent = PARENT_FORM[element.form.qualifier_name](
                        content=element.qualifier,
                    )
                    # Add the parent to the list of child elements.
                    element.children.append(add_parent)
                # Sort the elements by the index of child sort.
                element.children.sort(
                    key=lambda obj: element.form.child_sort.index(obj.tag)
                )
                # Loop through the element's children (if it has any).
                for child in element.children:
                    # Add the form attribute to the element.
                    child.add_form(
                        vocabularies=vocabularies,
                        qualifier=child.qualifier,
                        content=child.content,
                        parent_tag=element.tag,
                        superuser=superuser,
                    )
        element_group_dict = {}
        # Group related objects together.
        for element in children:
            # Make meta-hidden its own group.
            if element.form.name == 'meta' and element.qualifier == 'hidden':
                element_group_dict['hidden'] = [element]
            # Element is not meta-hidden.
            else:
                # Make sure the dictionary key exists.
                if element.form.name not in element_group_dict:
                    element_group_dict[element.form.name] = []
                element_group_dict[element.form.name].append(element)
        # If the hidden meta element doesn't exist, add it to its own group.
        if 'hidden' not in element_group_dict:
            hidden_element = PYUNTL_DISPATCH['meta'](
                qualifier='hidden',
                content='False')
            hidden_element.add_form(
                vocabularies=vocabularies,
                qualifier=hidden_element.qualifier,
                content=hidden_element.content,
                superuser=superuser,
            )
            element_group_dict['hidden'] = [hidden_element]
        # Create a list of group object elements.
        element_list = self.create_form_groupings(
            vocabularies,
            solr_response,
            element_group_dict,
            sort_order,
        )
        # Return the list of UNTL elements with form data added.
        return element_list
Create groupings of form elements.