(root, question, xmlns='')
return node
Given an xml element, find the node corresponding to a question path.
    See XFormQuestionValueIterator for question path format.
    Throws XFormQuestionValueNotFound if question is not present.
Given an xml element, find the node corresponding to a question path.
    See XFormQuestionValueIterator for question path format.
    Throws XFormQuestionValueNotFound if question is not present.
Given an xml element find the node corresponding to a question path . See XFormQuestionValueIterator for question path format . Throws XFormQuestionValueNotFound if question is not present .
def get_node(root, question, xmlns=''):
    '''
    Given an xml element, find the node corresponding to a question path.
    See XFormQuestionValueIterator for question path format.
    Throws XFormQuestionValueNotFound if question is not present.
    '''

    def _next_node(node, xmlns, id, index=None):
        try:
            return node.findall("{{{}}}{}".format(xmlns, id))[index or 0]
        except (IndexError, KeyError):
            raise XFormQuestionValueNotFound()

    node = root
    i = XFormQuestionValueIterator(question)
    for (qid, index) in i:
        node = _next_node(node, xmlns, qid, index)
    node = _next_node(node, xmlns, i.last())
    if node is None:
        raise XFormQuestionValueNotFound()
    return node
def get_node ( root , question , xmlns = '' ) : def _next_node ( node , xmlns , id , index = None ) : try : return node . findall ( "{{{}}}{}" . format ( xmlns , id ) ) [ index or 0 ] except ( IndexError , KeyError ) : raise XFormQuestionValueNotFound ( ) node = root i = XFormQuestionValueIterator ( question ) for ( qid , index ) in i : node = _next_node ( node , xmlns , qid , index ) node = _next_node ( node , xmlns , i . last ( ) ) if node is None : raise XFormQuestionValueNotFound ( ) return node