The market town of Malmesbury in Wiltshire is hardly a picture of deprivation.
The 13th-century abbey looks out over well-kept stone buildings. Any unemployment has been sucked up by the advent of Dyson - the electrical goods manufacturer. And the villages in the surrounding countryside, once home to rural poverty, are sprouting middle-class estates for managers from nearby Swindon.
So the 100-square-mile catchment area for Malmesbury school, the town's 1,070-pupil comprehensive, would not be expected to produce many social problems. Only 30 pupils on free school meals, a handful from ethnic minorities, truancy last year running at only 0.4 per cent - these are figures to make an inner-city school head blink with disbelief.
Yet, staff find that an increasing amount of their time is spent on the emotional and behavioural problems their pupils bring to school.
"We have a fair number of difficult youngsters," says Andrew Butterworth, deputy head responsible for pastoral care. "And our perception is that it is steadily increasing."
Part of the reason, he explains, is Wiltshire's drive towards social inclusion. Far fewer children with behavioural problems are now sent to special schools. But over the past four to five years, staff have also found a rise in low-level, unacceptable behaviour by pupils and more challenges from parents to sanctions on their children.
Is family breakdown to blame for the rise in challenging behaviour? Some of the most difficult and time-consuming cases involve children from deprived backgrounds. But other cases may arise where middle-class working parents spend too little time with their children. Andrew Butterworth says several pupils could have been permanently excluded by now if the school's pastoral system had not "kept them going". (The school's last permanent exclusion was in 1995). Temporary exclusions are on the rise - up from 34 last year to 56 this year, mostly for abusive language to staff or for refusing to co-operate.
Pivotal to the school's pastoral system are the heads of year. They have an extra four to six hours a week of non-contact time to cope with the work but it is never enough.
Head of Year 9 is Rachael Allaway, a physical education and English teacher, who says she spent four or five hours last week solely on one "looked-after" child. "And I've got 185 others to look after." She has been head of year for the same group since they were in Year 7 and finds the time it takes has risen greatly as pupils have got older. "This year, they've got SATs, option choices and hormones by the bucket-load," she explains, "but I do enjoy it."
Her life is made harder by a handful of "distinctly unco-operative" parents, who never turn up at meetings, write hostile letters and make threatening telephone calls in response to proposed sanctions against their child. She has never faced physical violence, although one father threatened to "come looking for her" if his child was given an after-school detention. (The detention went ahead and nothing happened.) Bob Basley, head of Year 11 and joint head of provision for children with emotional or behavioural difficulties, says in the past couple of years, he has noticed a lot more depression among children.
Although he worries about the rise in challenging behaviour, deputy head Andrew Butterworth thinks the pastoral role of schools is one of the glories of British education. It's one of the reasons this former social worker turned to teaching.
"I think the spin-off on the whole is a pretty good relationship between teachers and students," he says, pointing out that teachers, with their daily contact with children, are in a much better position to help youngsters overcome their problems than social workers, who have less frequent and more artificial contact.
He would like to see social services use Malmesbury school as their local centre, with a social worker on site. It would save a lot of inter-agency toing and froing, he says. But so far the suggestion has fallen on stony ground.