Set-shifting is an important aspect of attention and regulation of behaviour. The ability of young children to shift set is debated. Set-shifting is usually examined using sorting tasks that are designed for adults and hence are inadequate for children. In this study, an experimental Sorting Task for Children (STC) is administered to 54 healthy children (aged 4 to 10 years) and compared with a widely used adult sorting task, the Modified Card Sorting Test. This experiment shows that preschool children are capable of set-shifting. An extensive error analysis of the STC reveals that perseverations are not predominant. Hence, set-shifting in young children may be characterised by 'trial and error' rather than by being stuck in a mental set, which is suggested to be typical of adults with frontal lobe damage. A pilot study of 10 children with idiopathic or cryptogenic epilepsy shows unstable set-shifting rather than inability to shift set, which is concordant with known problems in regulation of behaviour.