#NEWLINE# def __getitem__( self , index ) : #NEWLINE# #INDENT# if ( type ( index ) is str ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# el = self . get_element ( index ) #NEWLINE# #UNINDENT# except XMLPathError as err : #NEWLINE# #INDENT# raise KeyError ( err ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return el #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return self . _children [ index ]