Heat oil in a frying pan, add onions and cook over low heat for 10 minutes until very soft. Add sugar and balsamic and cook for a further 10 minutes until thick, sweet and syrupy. Cool.
Meanwhile, arrange tomatoes, cut side down onto a paper towel-lined tray. Cut six circles of pastry from the sheets to snugly fit the top of 6 x 10 cm pie tins, but don't line. Chill.
Grease tins and arrange tomatoes cut side up into base. Season with salt and pepper. Top with a layer of caramelised onion.
Cover with a pastry circle pushing down gently. Place on a baking tray and bake for 30 minutes, or until golden. Leave to cool for 5 minutes. Turn out onto plates and top with some goat's cheese and basil leaves.