How do you educate children about the realities of the legal system from the confines of a classroom?
"Madam Fiscal, who is your first witness?" There is a rustle of papers as the booming voice echoes around the room.
Through the open window, you can hear a distant rumble of traffic. If you shut your eyes, for just a moment, you could be sitting in any sheriff's court in Scotland.
But the high-pitched reply shatters the illusion. The chief prosecutor is a schoolgirl with a ponytail.
Present are the accused, jurors, lawyers, clerks and police officers, but we are actually in a classroom of 10-year-olds.
Today's case involves a charge of malicious damage. Solicitor advocate John Scott has come to the Victoria Primary School in Newhaven, on the outskirts of Edinburgh, to play the role of sheriff.
All eyes are fixed on him as he speaks, and the concentration is intense. You could hear a pin drop.
Then a cherubic-looking boy who claims he is a 67-year-old pensioner appears in the witness box.
He complains that the suspect threw a brick through his window.
It was dark at the time, but he recalls that the culprit was wearing a leather jacket with a red and yellow dragon tattoo.
Over in the dock, his shifty-looking classmate stares straight ahead and says nothing.
Nobody fidgets or sniggers. The jurors are frantically scribbling notes.
Only one pupil seems to have lost interest - the diminutive policeman sitting next to the accused.
Overcome by the afternoon heat, he is snoozing, head down on his desk.
The children are taking part in an initiative called the MiniTrial.
It was set up by a High Court judge to help schools find out more about the Scottish legal system.
The aim is to demystify the law and allow pupils to see what really happens in a criminal court.
Sandy Wylie QC, also known as Lord Kinclaven, who masterminded the scheme, was inspired by a similar project in Minnesota.
"I wanted to adapt it to Scottish procedures," he says.
"Because if children do know anything about the way trials are run, their knowledge is usually based on American films or shows like The Bill they've seen on television.
"That can cause a lot of confusion because we do things a bit differently up here."
Indeed Scotland has retained its unique legal system throughout more than 300 years of union with England.
I notice that 15 chairs have been put out for the jury rather than the customary 12 in England.
Later, as the jurors gather in a huddle in the school corridor, they find that a simple majority of eight votes to seven is enough to convict the accused.
But after much deliberation, they decide to return the distinctively Scottish verdict of "not proven".
They are also taught about a cornerstone of Scots law, corroboration, which means that before a piece of evidence can be relied upon in court, it has to be supported by a second piece of evidence.
"That was pretty close to the way a real trial is conducted", says solicitor advocate John Scott afterwards.
"Far too many people come to court for the first time as active participants and they don't really know what it is going on, whereas these kids have got a very good idea."
There is another MiniTrial designed for even younger primary school children, aged seven and eight called Her Majesty Advocate v Goldilocks.
Needless to say the charge against the accused is that she maliciously damaged property belonging to three bears.
Mr Scott says the MiniTrials have inspired some children to opt for legal careers.
One MiniTrial pupil went on to do work experience with his firm, got a traineeship and has just become a qualified lawyer.
However, Lord Kinclaven says, "Our mission is not to turn people into lawyers".
He adds that when pupils visit courtrooms, they have a chance to see what the court officer does, what the sheriff clerk's job is, or the jury minder and also to see how the Reliance officers in charge of security carry out their job, to see inside Reliance vans which transport prisoners and to look inside the cells.
"We expose them to a whole range of features of our criminal and civil procedure," Lord Kinclaven says.
"I am inviting them not to be complacent. They can be critical if they like, but it is better if they criticise from a position of understanding of what we do and why."
Joan Spencer, a teacher from Edinburgh's Trinity Academy who has been closely involved with the project, feels the MiniTrials bring much broader educational benefits.
Secondary school pupils play out trials not in their classrooms but in actual courts and the cases they are given often involve abuse of alcohol and drugs.
"The teenagers see just how many accidents and assaults are caused by excessive drinking and it is really important early on for them to understand the link between alcohol and violence," she says.