Image copyright Getty Images Image caption Despite the prevalence of female leaders in the past 20 years at Holyrood, the number of female MSPs has fallen

Diversity among the Scottish Parliament's elected representatives has "gone backwards" in some ways, MSPs have warned in a new BBC documentary.

It comes 20 years after the first MSPs took their seats at Holyrood.

Despite the recent prevalence of female leaders, the 2016 Scottish Parliament election saw fewer women elected compared with 1999.

The parliament has also elected only four MSPs from ethnic minority backgrounds in the past two decades.

The 1999 Scottish Parliament election returned 48 women to the chamber out of 129 MSPs. By the 2016 election that number had fallen to 45.

'Hate-filled world'

Former Scottish Labour leader Iain Gray, who was first elected to Holyrood in 1999, told the documentary, titled Children of the Devolution: "We've never had a black woman MSP, that's never happened in 20 years. In some ways we've gone backwards."

Image caption Anas Sarwar said he could not stay silent on the issue of diversity

Anas Sarwar MSP, who last year set up a Cross Party Group on tackling Islamophobia, said Scotland still had a long way to go on issues of equality.

Mr Sarwar told the programme: "You come to the realisation at some point - and part of it is when you become a parent yourself and you see the challenges that your children might face in the future - that I can't stay silent, silence isn't an option any more.

"I genuinely believe that my children are going to grow up in a more divided and a more hate-filled world than the one I grew up in and that frightens the life out of me.

"And I think we need people of all backgrounds talking about (it), and we all care about Scotland and we've got a long, long way to go."

Image copyright Getty Images

SNP MSP Linda Fabiani, who has also been in the Edinburgh parliament from the start, said: "If you say that a parliament should reflect the people that it serves, I think we do that in quite a lot of ways.

"We're not quite there yet with equality for women and we're certainly not there yet with other equalities that we need to take notice of. But the will is there."

Bitter political argument

The first episode of the documentary will reflect primarily on the early years of the new Scottish Parliament, which was formally opened by the Queen on 1 July 1999.

One early controversy also centred around the issue of equality and moves by the then Labour-Liberal Democrat executive to scrap the controversial Section 28 or clause 2A law that banned the "promotion" of homosexuality in schools.

A high-profile campaign to keep the clause was led by businessman Sir Brian Souter, who funded a postal referendum on the issue.

After months of bitter political argument, MSPs voted to repeal the law in June 2000.

Image copyright Getty Images Image caption Ruth Davidson told the programme the 2014 law change on same-sex marriage brought her to tears

Scottish Conservative leader Ruth Davidson said: "I really hated that idea that one rich person could have ownership over a whole idea, it really brought home to me that it is not always a fair playing field and that really stuck in my craw."

Ms Davidson also reflected on the 2014 law change that would allow same-sex couples to marry in Scotland.

"When the bill was finally passed, I went back up the stairs to my office and I burst into tears," she told the BBC.

"After that, very late on, I went to a get-together in the pub with some of the campaigners and through a weird series of events someone there put me in touch with the person who is now my fiancee, so it almost started another chapter of my life."

Episode one of Children Of The Devolution is on BBC Scotland at 22:00 on Tuesday.