#NEWLINE# def render( self , level ) : #NEWLINE# #INDENT# result = ( ( _indent ( level ) + '<' ) + self . _name ) #NEWLINE# if ( self . _attributes is not None ) : #NEWLINE# #INDENT# result += _serialize_attributes ( self . _attributes ) #NEWLINE# #UNINDENT# if ( self . _children is None ) : #NEWLINE# #INDENT# result += ' />' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result += '>' #NEWLINE# if self . _children : #NEWLINE# #INDENT# if ( ( ( len ( self . _children ) == 1 ) and isinstance ( self . _children [ 0 ] , basestring ) ) or ( self . _children [ 0 ] is None ) ) : #NEWLINE# #INDENT# result += escape ( self . _children [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result += _new_line ( level ) #NEWLINE# if ( level is not None ) : #NEWLINE# #INDENT# level += 1 #NEWLINE# #UNINDENT# result += _render_iteratable ( self . _children , level ) #NEWLINE# if ( level is not None ) : #NEWLINE# #INDENT# level -= 1 #NEWLINE# #UNINDENT# result += _indent ( level ) #NEWLINE# #UNINDENT# #UNINDENT# result += ( ( '</' + self . _name ) + '>' ) #NEWLINE# #UNINDENT# result += _new_line ( result ) #NEWLINE# return result