def findattr(node, attrname):
    """Find the attribute under `node` with a matching attribute name.

    Args:
        node: An lxml etree Element object.
        attrname: An XML attribute name.

    Returns:
        An lxml etree ElementStringResults object if found or None if not found.
    """
    if not attrname.startswith('@'):
        attrname = '@%s' % attrname
    return next(iter(node.xpath(attrname)), None)
