Add empty values for ETD_MS fields that don't have values.

def add_empty_etd_ms_fields(etd_ms_dict):
    """Add empty values for ETD_MS fields that don't have values."""
    # Determine which ETD MS elements are missing from the etd_ms_dict.
    for element in ETD_MS_ORDER:
        if element not in etd_ms_dict:
            # Try to create an element with content and qualifier.
            try:
                py_object = ETD_MS_CONVERSION_DISPATCH[element](
                    content='',
                    qualifier='',
                )
            except:
                # Try to create an element with content.
                try:
                    py_object = ETD_MS_CONVERSION_DISPATCH[element](content='')
                except:
                    # Try to create an element without content.
                    try:
                        py_object = ETD_MS_CONVERSION_DISPATCH[element]()
                    except:
                        raise PyuntlException(
                            'Could not add empty element field.'
                        )
                    else:
                        etd_ms_dict[element] = [{'content': {}}]
                else:
                    # Handle element without children.
                    if not py_object.contained_children:
                        etd_ms_dict[element] = [{'content': ''}]
                    else:
                        etd_ms_dict[element] = [{'content': {}}]
            else:
                # Handle element without children.
                if py_object:
                    if not py_object.contained_children:
                        etd_ms_dict[element] = [{'content': '',
                                                 'qualifier': ''}]
                else:
                    etd_ms_dict[element] = [{'content': {},
                                             'qualifier': ''}]
            # Add empty contained children.
            if py_object:
                for child in py_object.contained_children:
                    etd_ms_dict[element][0].setdefault('content', {})
                    etd_ms_dict[element][0]['content'][child] = ''
    return etd_ms_dict