<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_values_to_run_xml(self, run):
 """ This function adds the result values to the XML representation of a run. """

        runElem = run.xml
        for elem in list(runElem):
            runElem.remove(elem)
        self.add_column_to_xml(runElem, 'status',    run.status)
        self.add_column_to_xml(runElem, 'cputime', run.cputime)
        self.add_column_to_xml(runElem, 'walltime', run.walltime)
        self.add_column_to_xml(runElem, '@category', run.category) # hidden
        self.add_column_to_xml(runElem, '',          run.values)

        for column in run.columns:
            self.add_column_to_xml(runElem, column.title, column.value)

        # Sort child elements by hidden and title attributes
        runElem[:] = sorted(runElem, key=lambda elem : (elem.get('hidden', ''), elem.get('title')))