import re


def normalize_s3_key(key):
    """
    remove leading / from key if present as the signing key uses it but the browser
     swallows the // to make it / which gives a download error
    :param key: str
    :return: transformed_key: str

    >>> _normalize_s3_key('/tmp/abc.xml')
    'tmp/abc.xml'

    >>> _normalize_s3_key('tmp/xyz.xml')
    'tmp/xyz.xml'

    >>> _normalize_s3_key('/')
    ''
    """
    leading_slashes = r"^//*"

    compiled_pattern = re.compile(leading_slashes)

    return key[1:] if compiled_pattern.match(key) else key