'Requires:
my_string --string to parse
type --type of string
Returns:
A string for a toc instruction field.
Logic:
This method is meant for *both* index and toc entries.
I want to eleminate paragraph endings, and I want to divide the
entry into a main entry and (if it exists) a sub entry.
Split the string by newlines. Read on token at a time. If the
token is a special colon, end the main entry element and start the
sub entry element.
If the token is a pargrah ending, ignore it, since I don\'t won\'t
paragraphs within toc or index entries.'

def __parse_index_func(self, my_string):

    (my_string, see_string) = self.__index_see_func(my_string)
    (my_string, bookmark_string) = self.__index_bookmark_func(my_string)
    (italics, bold) = self.__index__format_func(my_string)
    found_sub = 0
    my_changed_string = 'mi<tg<empty-att_<field<type>index-entry'
    my_changed_string += '<update>static'
    if see_string:
        my_changed_string += ('<additional-text>%s' % see_string)
    if bookmark_string:
        my_changed_string += ('<bookmark>%s' % bookmark_string)
    if italics:
        my_changed_string += '<italics>true'
    if bold:
        my_changed_string += '<bold>true'
    main_entry = ''
    sub_entry = ''
    lines = my_string.split('\n')
    for line in lines:
        token_info = line[:16]
        if (token_info == 'cw<ml<colon_____'):
            found_sub = 1
        elif (token_info[0:2] == 'tx'):
            if found_sub:
                sub_entry += line[17:]
            else:
                main_entry += line[17:]
    my_changed_string += ('<main-entry>%s' % main_entry)
    if found_sub:
        my_changed_string += ('<sub-entry>%s' % sub_entry)
    my_changed_string += '\n'
    return my_changed_string
