def pad_gtin(app_identifier, value):
    """
    Pad the value of any GTIN [ AI (01) or (02) ] to 14 digits
    in the element string representation.

    :param app_identifier: Application identifier.
    :param value: The GTIN string - can be 8, 12 or 13 digits.
    :return: GTIN string with zeros padded to the left, and will be 14-digit.
    """
    new_value = value
    if app_identifier in ["01", "(01)", "02", "(02)"]:
        if len(value) == 8:
            new_value = ''.join(['000000', value])
        elif len(value) == 12:
            new_value = ''.join(['00', value])
        elif len(value) == 13:
            new_value = ''.join(['0', value])
    return new_value