def METHOD_NAME(self, filename: str) -> None:
    """update and clean the xml and then write the input file
    Args:
        filename (str): filename in the
    """
    # create a dict of the user providedoptions
    options = self._opts.to_flat_dict()
    # update the options from the user provided input
    xml_tree_cpy = update_xml_text(self._xml_tree, options)
    # remove the empty elements
    xml_tree_cpy = remove_empty_text_elements(xml_tree_cpy)
    # write the file
    xml_tree_cpy.write(filename)