Melt butter in a large, deep pot (one that has a lid) over medium heat. Add onions, and stir to coat with butter. Cover; cook 15 minutes, stirring occasionally until onions are very soft and begin to turn golden brown.
Uncover and increase heat to medium-high. Stir in sugar. Cook, uncovered, 6 to 7 minutes, stirring often. Sprinkle with flour and cook 1 minute longer. Stir in broth, sherry or wine and 1 cup water. Simmer, uncovered, for 5 minutes.
Heat broiler. Spread bread slices onto a baking sheet; toast under broiler for 1 to 2 minutes per side (or use a toaster). Set aside. Place six oven-proof bowls or crocks onto baking sheet. Divide soup evenly among bowls (about a cup in each).
Use a vegetable peeler or cheese plane to thinly slice pieces of cheese. Place slice of toast on each serving of soup, top with cheese. Heat under broiler for 3 minutes, or until cheese is melted and bubbly. Carefully remove from oven and serve warm.