This is not really an XEmacs thing but hit me when I tried to get gnus working with XEmacs under cygwin. It seems you need to install the openssl development package under cygwin to get the openssl command line tool. That took me some time to figure out.
Connecting to an imap server using the same setup as under Linux produced no error message about the openssl tool missing. I just got an unhelpful connection denied form gnus. That error message fooled me into a bunch of other possible error causes before I understood that it was just that the tool openssl that was missing.