The enemy is erosion, caused by weather and time, and it takes an army of 610 highly skilled Historic Scotland craftsmen to keep the monuments from crumbling away.
In recent years, Historic Scotland has been exploring ways it can service more than just history in the curriculum. And it wants to attract more secondary schools. Three years ago it had the idea of providing construction crafts workshops for the Skills for Work agenda.
"We have aimed it at young people in S2, before they choose their options, who might be interested in design and technology departments," says Kaye Finlay, an education officer with Historic Scotland, which teamed up with Careers Scotland to run the workshops this month at Stirling Castle.
Specialists from Historic Scotland showed the wide range of crafts used to maintain its buildings. Every secondary in the Forth Valley area was invited to bring pupils to the castle to do stonecarving, secure roof slates in place, whittle wood in joinery and mould metal in leadworking.
The three-day event was an extension of the one-day sessions run in October 2005-06 at Stirling to coincide with National Construction Week. This time, more schools from a larger area were invited.
"The schools in the Forth Valley included Stirling, Falkirk and Clackmannanshire, and all 18 accepted," says Carole McNairney, an enterprise in education adviser with Careers Scotland. "It is rare for us to get so many schools involved."
The 24 pupils at the first session were a mix of S2 design and technology students from Bannockburn, McLaren and Balfron high schools. Few of the girls showed much enthusiasm for a career in these fields, but some of the boys had already decided it was for them.
Alan Paton, from S2 at Bannockburn, tried building a roof truss without nails or glue as he wants to be a joiner. His classmates Greg McEwan and David Cross are also thinking of careers in construction.
"I liked learning how to build up a slate roof," said David. "I never realised it was done like that.
Greg said: "It was good the way you got to do it for yourself. I've only ever got to do stuff like that in design and technology before."
Each group did a 20-minute session at one of four purpose-built workstations before being taken up to Stirling Castle to see the crafts in action. There, Duncan Peet, Historic Scotland's architectural technician at the castle, introduced them to the skills used to restore the Great Hall, built in 1503. They were then shown the palace, built in 1538, which is due for an pound;11 million refurbishment over the next three to four years. The craftsmen will carve thousands of pieces of new stonework, restore fire-places and doorways and re- build joists, flooring and windows.
The palace will close soon for the restoration, so the Forth Valley pupils were some of the last visitors. But while the other tourists considered the lives of Mary Queen of Scots, the pupils observed another perspective, considering how the heating would be installed and the roof kept up.