3 mild chiles (can certainly use more if you like).
Bring to a boil
2 c milk
1/4 c water (use liquid from canned corn)
1/2 tsp salt (a bit more if you don't use the canned corn liquid).
Once that's boiling, combine (don't let it sit long)
3/4 c cornmeal
3/4 c cold water (use liquid from canned corn)
and stir into the boiling milk. Stir continuously until it comes back to simmer and thickens; turn heat down and simmer 15 minutes (or longer), covered, stirring occasionally. (If you let the polenta cool it will solidify, so have everything else ready before you take it off the heat. It won't be harmed by cooking longer.) Just before taking it off heat, stir in
1/2 c parmesan (or a bit more).
Meanwhile, peel, seed, and chop the roasted chiles; chop
2-3 canned chipotles (more if they're mild)
and mix with the chiles.
Layer in a greased casserole:
polenta, chiles, and
1 c corn (or a bit more)
2/3 c chopped cilantro
1/2 lb (2 c) shredded jack cheese
1/2 c heavy cream.
(The layers I use, from the bottom up:
a bit less than half of the polenta
a bit more than half of the cheese
a bit less than half of the cream
the rest of the polenta
the rest of the cheese
the rest of the cream.)
Bake 400° for 30 min, until well browned.
The advantage of canned corn over frozen (I've tried both) is that the liquid is a good addition to the taste of the polenta. (You won't have a full cup, just use what you have and water for the rest.)
I haven't described how to roast chiles here—I assume there are plenty of places on the web that will tell you how if you need it.
I bet diced nopales would be a good substitute for the chiles—haven't tried it.
An update: If you want this to come out at all solid, you'll need to let it cool (or chill) before you bake it. If you bake it immediately it'll come out very soupy. Still tasty, but a very different result.
Another update: The cilantro really doesn't add much, as it loses almost all taste when cooked; I've been asked if it was spinach. Culantro would work, but I can rarely get it. Cilantro stems do keep some taste, but it's a lot of work to get enough. I know cilantro root stands up to cooking, but I wonder about the texture.
Yet another update: I've realized there's more advantage to canned corn than just the juice—it's bred and processed to remain crisp with more cooking, especially if you choose one with 'crisp' in the label. Frozen corn tends to toughen in anything that gets baked.