'Parse and return the <degree> scale degree modification element.'

def _parse_degree(self, xml_degree):

    if (xml_degree.find('degree-value') is None):
        raise ChordSymbolParseException('Missing    scale    degree    value    in    harmony')
    value_text = xml_degree.find('degree-value').text
    try:
        value = int(value_text)
    except ValueError:
        raise ChordSymbolParseException(('Non-integer    scale    degree:    ' + str(value_text)))
    alter_string = ''
    if (xml_degree.find('degree-alter') is not None):
        alter_text = xml_degree.find('degree-alter').text
        alter_string = self._alter_to_string(alter_text)
    if (xml_degree.find('degree-type') is None):
        raise ChordSymbolParseException('Missing    degree    modification    type')
    type_text = xml_degree.find('degree-type').text
    if (type_text == 'add'):
        if (not alter_string):
            type_string = 'add'
        else:
            type_string = ''
    elif (type_text == 'subtract'):
        type_string = 'no'
        alter_string = ''
    elif (type_text == 'alter'):
        if (not alter_string):
            raise ChordSymbolParseException('Degree    alteration    by    zero    semitones')
        type_string = ''
    else:
        raise ChordSymbolParseException(('Invalid    degree    modification    type:    ' + str(type_text)))
    return ((type_string + alter_string) + str(value))
