def METHOD_NAME(convert):
    # Instantiate the energy group data
    groups = openmc.mgxs.EnergyGroups(group_edges=[1e-5, 0.625, 20.0e6])
    # Instantiate the 2-group (C5G7) cross section data
    uo2_xsdata = openmc.XSdata('UO2', groups)
    uo2_xsdata.order = 2
    uo2_xsdata.set_total([2., 2.])
    uo2_xsdata.set_absorption([1., 1.])
    scatter_matrix = np.array([[[0.75, 0.25],
                                [0.00, 1.00]],
                               [[0.75 / 3., 0.25 / 3.],
                                [0.00 / 3., 1.00 / 3.]],
                               [[0.75 / 4., 0.25 / 4.],
                                [0.00 / 4., 1.00 / 4.]]])
    scatter_matrix = np.rollaxis(scatter_matrix, 0, 3)
    uo2_xsdata.set_scatter_matrix(scatter_matrix)
    uo2_xsdata.set_fission([0.5, 0.5])
    uo2_xsdata.set_nu_fission([1., 1.])
    uo2_xsdata.set_chi([1., 0.])
    mg_cross_sections_file = openmc.MGXSLibrary(groups)
    mg_cross_sections_file.add_xsdatas([uo2_xsdata])
    if convert is not None:
        if isinstance(convert[0], list):
            for conv in convert:
                if conv[0] in ['legendre', 'tabular', 'histogram']:
                    mg_cross_sections_file = \
                        mg_cross_sections_file.convert_scatter_format(
                            conv[0], conv[1])
                elif conv[0] in ['angle', 'isotropic']:
                    mg_cross_sections_file = \
                        mg_cross_sections_file.convert_representation(
                            conv[0], conv[1], conv[1])
        elif convert[0] in ['legendre', 'tabular', 'histogram']:
            mg_cross_sections_file = \
                mg_cross_sections_file.convert_scatter_format(
                    convert[0], convert[1])
        elif convert[0] in ['angle', 'isotropic']:
            mg_cross_sections_file = \
                mg_cross_sections_file.convert_representation(
                    convert[0], convert[1], convert[1])
    mg_cross_sections_file.export_to_hdf5()