@staticmethod<EOL><INDENT>def query(dom, query, context=None, tagid=None):<DEDENT>
if context is None:<EOL><INDENT>source = dom<EOL><DEDENT>else:<EOL><INDENT>source = context<EOL><DEDENT>if tagid is None:<EOL><INDENT>return source.xpath(query, namespaces=OneLogin_Saml2_Constants.NSMAP)<EOL><DEDENT>else:<EOL><INDENT>return source.xpath(query, tagid=tagid, namespaces=OneLogin_Saml2_Constants.NSMAP)<EOL><DEDENT>
Extracts nodes that match the query from the Element

:param dom: The root of the lxml objet
:type: Element

:param query: Xpath Expresion
:type: string

:param context: Context Node
:type: DOMElement

:param tagid: Tag ID
:type: string

:returns: The queried nodes
:rtype: list