In many EU countries neither head of state/government are elected then.
This is not the case for the EU institutions, where the EP is the least powerful body by far. While the EP 'elects' the head of the Commission and confirms the members, it does not choose them. It is not possible to be elected head of the Commission without being nominated by the European Council. This is so far removed from a democratic process we can't really call it an election.