#NEWLINE# def findNamedNode( self , name , nameattr , root = None ) : #NEWLINE# #INDENT# " return the toplevel node with the provided name, and the fitting 'name' attribute. " #NEWLINE# if ( root == None ) : #NEWLINE# #INDENT# root = self . root #NEWLINE# #UNINDENT# for n in root . childNodes : #NEWLINE# #INDENT# if ( n . nodeName == nameattr ) : #NEWLINE# #INDENT# if n . attributes [ 'name' ] : #NEWLINE# #INDENT# if ( n . attributes [ 'name' ] . value == nameattr ) : #NEWLINE# #INDENT# return n #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return None