xml_result = tokens.asXML()
for tok in tokens:
    needle = '\\<([^\\>]+)\\>\\s*%s\\s*\\<\\/' % tok
print(tok, '=', re.search(needle, xml_result).groups()[0])
how can I get the token instead of string?