Step 1Melt butter in a large Dutch oven or pot over medium heat. Add onion and season with salt. Reduce heat to medium-low and cook, stirring often at first and then only occasionally, until onions are golden brown and caramelized, 1 hour to 1 hour 15 minutes.
Step 2Add white wine and dry sherry and bring to a boil. Add flour and cook, stirring, until thickened, 1 to 2 minutes. Stir in broth and let simmer 10 minutes. Season with salt.
Step 3Heat oven to broil. Place 4 broiler-safe bowls on a sheet tray and fill with soup. Top each with a slice of bread (trimming to fit, if necessary) and cheese, dividing evenly. Broil until cheese is golden brown, 1 to 2 minutes. Serve immediately.