#NEWLINE# def increment_xmltag_id( xmltag_id , position = 'sibling' ) : #NEWLINE# #INDENT# if ( position == 'sibling' ) : #NEWLINE# #INDENT# ( root , last_number ) = rx_xmltag_sibling_id . match ( xmltag_id ) . groups ( ) #NEWLINE# return ( '%s%d' % ( root , ( int ( last_number ) + 1 ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( root == 'child' ) : #NEWLINE# #INDENT# return ( '%si1' % xmltag_id )