Lightly oil an ovenproof dish measuring 30 x 20 cm (12 x 8 inches) or similar. Trim the filo sheets to fit into the base. Cover with a clean, damp tea towel (dish towel) and set aside.
Put the eggplant in a colander, sprinkle with the salt and set over a bowl for 20 minutes to drain. Rinse, then pat dry.
Meanwhile, make the tomato filling. Heat 2 tablespoons of the oil in a large pan and cook the onions over a medium heat until very soft and golden. Add the garlic and tomato paste and cook for a few minutes more. Add the tomatoes, sugar and oregano and simmer for 10 minutes. Add the beans, season with salt and pepper and cook for 5 minutes more. Set aside.
To make the eggplant filling, put the eggplant in a food processor and roughly mince. Transfer to a mixing bowl and add the flax eggs, breadcrumbs, cheese, basil, the olive oil, garlic, parsley, sultanas, pine nuts and salt and pepper. Stir.
Heat the oven to 200°C (400°F/Gas 6). Brush 4 sheets of the filo with oil and layer one on top of the other. Put the oiled sheets in the baking tray and spread the tomato mixture on top. Make another 4-sheet layer of filo as before and put on top. Cover with the eggplant mixture. Make a final 4-sheet filo layer and put on top. Brush with oil and bake for 35 minutes, or until golden and cooked through. Serve hot.