def setGrade(headrow):
    """
    Returns 'gradeText' based on grade.value.  This is
    numeric in the xml, but I just give them the text
    values that are used in the MBSA interface.  These are:

    0 == Check Passed
    1 == Additional Information
    2 == Check Failed (Critical)
    3 == Check Failed (Non-Critical)
    4 == Note Message
    5 == Check Passed
    """
    grade = ""
    gradeText = ""
    if headrow.hasAttributes() != False:
        grade = headrow.attributes["Grade"]
        #print grade.value
        if grade.value == '0':
            gradeText = "Check Passed"
        elif grade.value == '1':
            gradeText = "Additional Information"
        elif grade.value == '2':
            gradeText = "Check Failed (Critical)"
        elif grade.value == '3':
            gradeText = "Check Failed (Non-Critical)"
        elif grade.value == '4':
            gradeText = "Note Message"
        elif grade.value == '5':
            gradeText = "Check Passed"

    return gradeText

    Returns 'gradeText' based on grade.value.  This is
    numeric in the xml, but I just give them the text
    values that are used in the MBSA interface.  These are:

    0 == Check Passed
    1 == Additional Information
    2 == Check Failed (Critical)
    3 == Check Failed (Non-Critical)
    4 == Note Message
    5 == Check Passed
    
recipes/Python/305302_mbsa2txt/recipe-305302.py