def METHOD_NAME(element_html: str, data: pl.QuestionData) -> None:
    element = lxml.html.fragment_fromstring(element_html)
    raw_file_names = pl.get_string_attrib(element, "file-names", "")
    required_file_names = get_file_names_as_array(raw_file_names)
    answer_name = get_answer_name(raw_file_names)
    # Get submitted answer or return parse_error if it does not exist
    files = data["submitted_answers"].get(answer_name, None)
    if not files:
        add_format_error(data, "No submitted answer for file upload.")
        return
    # We will store the files in the submitted_answer["_files"] key,
    # so delete the original submitted answer format to avoid
    # duplication
    del data["submitted_answers"][answer_name]
    try:
        parsed_files = json.loads(files)
    except Exception:
        add_format_error(data, "Could not parse submitted files.")
        parsed_files = []
    # Filter out any files that were not listed in file_names
    parsed_files = [x for x in parsed_files if x.get("name", "") in required_file_names]
    if data["submitted_answers"].get("_files", None) is None:
        data["submitted_answers"]["_files"] = parsed_files
    elif isinstance(data["submitted_answers"].get("_files", None), list):
        data["submitted_answers"]["_files"].extend(parsed_files)
    else:
        add_format_error(data, "_files was present but was not an array.")
    # Validate that all required files are present
    if parsed_files is not None:
        submitted_file_names = [x.get("name", "") for x in parsed_files]
        missing_files = [
            x for x in required_file_names if x not in submitted_file_names
        ]
        if len(missing_files) > 0:
            add_format_error(
                data,
                "The following required files were missing: "
                + ", ".join(missing_files),
            )