def getHeadRow(detail, detailLength):
    """
    Sets the variable 'headrow' equal to the 'Head'
    or 'Row' elements.  (Which are siblings under
    'Detail'), grabs the length of the list in 'headrow',
    and loops through the list.  While looping through
    'headrow', it calls gradeText() and getCol().
    """
    # check.childNodes[checkx}.childNodes[detailx] <Head> and <Row>
    headrowx = 1 # loop iterator
    headrow = detail.childNodes[headrowx]
    headrowLength = len(headrow.childNodes)
    #print "detailLength = " + str(detailLength)
    #print "headrowLength = " + str(headrowLength)

    while headrowx <= (detailLength - 2):
        gradeText = setGrade(headrow)
        getCol(headrow, headrowLength, gradeText, headrowx)

        headrowx = headrowx + 2
        #print "headrowx = " + str(headrowx)
        if headrowx <= (detailLength - 2):
            headrow = detail.childNodes[headrowx]
            headrowLength = len(headrow.childNodes)

    print "\n"

    Sets the variable 'headrow' equal to the 'Head'
    or 'Row' elements.  (Which are siblings under
    'Detail'), grabs the length of the list in 'headrow',
    and loops through the list.  While looping through
    'headrow', it calls gradeText() and getCol().
    
recipes/Python/305302_mbsa2txt/recipe-305302.py