#NEWLINE# def make_node( path , modules , value = None ) : #NEWLINE# #INDENT# '\n    Makes a node or an XML fragment given a path, element module list, and an\n    optional value.\n    ' #NEWLINE# if ( type ( modules ) is not list ) : #NEWLINE# #INDENT# modules = [ modules ] #NEWLINE# #UNINDENT# pathelements = path . split ( '/' ) #NEWLINE# if ( not pathelements [ 0 ] ) : #NEWLINE# #INDENT# del pathelements [ 0 ] #NEWLINE# #UNINDENT# rootnode = current = _construct_node ( pathelements [ 0 ] , modules ) #NEWLINE# for element in pathelements [ 1 : ] : #NEWLINE# #INDENT# new = _construct_node ( element , modules ) #NEWLINE# current . append ( new ) #NEWLINE# current = new #NEWLINE# #UNINDENT# current . set_inline ( ) #NEWLINE# if ( value is not None ) : #NEWLINE# #INDENT# current . add_text ( value ) #NEWLINE# #UNINDENT# return rootnode