#NEWLINE# @ property #NEWLINE# def text( self ) : #NEWLINE# #INDENT# "\n        Return the <Relationships ...> XML for this rels item formatted for\n        minimal diffs. The <Relationship> child elements are sorted to remove\n        arbitrary ordering between package saves. rId values are all set to\n        'x' so internal renumbering between saves doesn't affect the\n        ordering.\n        " #NEWLINE# def anon( rel ) : #NEWLINE# #INDENT# return re . sub ( ' Id="[^"]+" ' , ' Id="x" ' , rel ) #NEWLINE# #UNINDENT# lines = self . xml . split ( '\n' ) #NEWLINE# relationships = [ l for l in lines if l . startswith ( '  <R' ) ] #NEWLINE# anon_rels = sorted ( [ anon ( r ) for r in relationships ] ) #NEWLINE# out_lines = ( ( lines [ : 2 ] + anon_rels ) + lines [ ( - 1 ) : ] ) #NEWLINE# out = '\n' . join ( out_lines ) #NEWLINE# return out