#NEWLINE# def to_tree( self ) : #NEWLINE# #INDENT# '\n        Alignment and protection objects are implemented as child elements.\n        This is a completely different API to other format objects. :-/\n        ' #NEWLINE# attrs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for key in ( self . __attrs__ + ( 'applyProtection' , 'applyAlignment' ) ) : #NEWLINE# #INDENT# value = getattr ( self , key ) #NEWLINE# if ( key in ( 'alignmentId' , 'protectionId' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( key in ( 'quotePrefix' , 'pivotButton' , 'applyProtection' , 'applyAlignment' ) ) and ( not value ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# attrs [ key ] = value #NEWLINE# #UNINDENT# attrs = dict ( ( ( k , safe_string ( v ) ) for ( k , v ) in attrs . items ( ) ) ) #NEWLINE# return Element ( self . tagname , attrs )