def test_connection_xnat(host, user, pwd):
    """
    Method to check connection to XNAT using host, user, pwd.

    :param host: Host for XNAT
    :param user: User for XNAT
    :param pwd: Password for XNAT
    :return: True if succeeded, False otherwise.
    """
    from pyxnat.core.errors import DatabaseError
    from pyxnat import Interface
    xnat = Interface(host, user, pwd)
    try:
        xnat._exec('/data/JSESSION', method='DELETE')
        print(' --> Good login.\n')
        return True
    except DatabaseError:
        print(' --> error: Wrong login.\n')
        return False
