def METHOD_NAME(e, attr ,ns=None):
    trace()
    # helper function to get the attribute, if a namespace is provided this name space will be looked up from the xml
    if ns is not None:
        return e.get("{<<NS>>}<<attr>>"
                     .replace("<<NS>>", e.nsmap[ns])
                     .replace("<<attr>>", attr))
    else:
        return e.get(attr)