def get_location(xmltag):
    """
    parses the given XML tag and returns location info (file, line, func)
    """
    ret = {}    
    tagloc = xmltag.find("location");
    if tagloc is not None:
        filename = tagloc.get("file")
        line = tagloc.get("line")
        func = tagloc.get("function")
        if filename : ret["file"] = filename
        if line : ret["line"] = line
        if func : ret["func"] = func
    return ret