Preheat your oven to 375°F (190°C).
Trim the ends of the endives and remove any damaged outer leaves.
In a large pot of boiling salted water, cook the endives for about 10-15 minutes until they are tender. Drain and let them cool slightly.
Squeeze out any excess water from the endives by gently pressing them between paper towels.
In a saucepan, melt the butter over medium heat.
Add the flour and stir to make a roux. Cook for about 2 minutes, stirring constantly, until the roux is lightly golden.
Gradually add the milk, whisking continuously to avoid lumps. Cook until the sauce thickens, about 5-7 minutes.
Season the béchamel sauce with ground nutmeg, salt, and pepper to taste.
Wrap each endive with a slice of ham and place them in a baking dish.
Pour the béchamel sauce over the ham-wrapped endives, ensuring they are well covered.
Sprinkle the grated Gruyère or Swiss cheese evenly over the top.
Bake in the preheated oven for about 20-25 minutes, or until the cheese is melted and golden brown on top.
Enjoy your meal!