def serialize_grades(grades):
    """
    Returns an string with the representation of the grades in XML format.

    :param grades: grades to serialize
    :return: an string with the representation in the desired format
    """
    result = '<scores>\n'

    for student_id, grade in grades.items():
        result += "\t<score>\n\t\t<studentId>" + str(student_id) + "</studentId>\n"
        result += "\t\t<value>" + str(grade.grade) + "</value>\n\t</score>\n"

    return result + '</scores>'