Chop the fennel fronds until fine and reserve. Slice the bulbs in half lengthwise, cutting out the cores, and
then slicing into ¼-inch slices.
Add the onion slices to the fennel slices in a large mixing bowl. Stir in
3 tablespoons of the olive oil, the rosemary, thyme, the remaining 2 teaspoons of sea salt, and the pepper. Mix well.
In a large saucepan, heat the remaining two tablespoons of oil over
medium-low heat. Stir in the fennel-onion mixture, cover and cook,
stirring often, until the vegetables are very soft and thick,
about 45 minutes.
Preheat the oven to 350°. Using your fingers, press the chilled tart dough evenly in a 10-inch tart pan with a removable bottom. Cover the dough with parchment paper and fill with pie weights, rice or dried beans to keep the dough from rising while it bakes. Bake for 15 minutes, then remove the weights and parchment paper. Bake for another 10 minutes until the crust is golden brown. Let cool slightly.
Remove the lid from the fennel-onion mixture and increase the heat to medium high, and cook about 5 minutes longer. Add salt and pepper, to taste. Spread the filling in the tart shell and sprinkle the chopped fennel greens and cheese (if using) evenly over the top. Serve hot or at room temperature.