#NEWLINE# @ staticmethod #NEWLINE# def parse( raw ) : #NEWLINE# #INDENT# 'Returns tuple of (session-id (str), capabilities (Capabilities)' #NEWLINE# ( sid , capabilities ) = ( 0 , [ ] ) #NEWLINE# root = to_ele ( raw ) #NEWLINE# for child in root . getchildren ( ) : #NEWLINE# #INDENT# if ( ( child . tag == qualify ( 'session-id' ) ) or ( child . tag == 'session-id' ) ) : #NEWLINE# #INDENT# sid = child . text #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( child . tag == qualify ( 'capabilities' ) ) or ( child . tag == 'capabilities' ) ) : #NEWLINE# #INDENT# for cap in child . getchildren ( ) : #NEWLINE# #INDENT# if ( ( cap . tag == qualify ( 'capability' ) ) or ( cap . tag == 'capability' ) ) : #NEWLINE# #INDENT# capabilities . append ( cap . text ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ( sid , Capabilities ( capabilities ) )