Image copyright Getty Images Image caption 'I am very lucky to have parents that never said that is not a woman's job.'

The Sultan of Yogyakarta holds a powerful political and spiritual position on the Indonesian island of Java. He is manoeuvring to make his eldest daughter his heir, sparking a bitter feud, as the BBC's Indonesia editor Rebecca Henschke reports.

"From generation to generation the sultan who reigns over Yogyakarta seems to adapt himself to the changing of times," says Wedono Bimo Guritno quietly as he ushers me through the elaborate palace complex.

He is one of the nearly 1,500 abdi dalam, members of the royal court. A keris, a sacred Javanese dagger, is tucked into his sarong.

"In the past it was not difficult to choose a prince, because in the past, the sultan had more than one wife," Wedono Bimo Guritno tells me. We duck under low gateways into a maze of tree-lined courtyards surrounding the Kraton Kilen, the Sultan's private residence.

"But you know it's always been women that hold the real power in Javanese households," Bimo says with a smile.

Image copyright Getty Images Image caption Gusti Kanjeng Ratu Hayu says she was raised to be equal with men

As is required of anyone entering the palace, I have been traditionally dressed and groomed for over an hour. I am in a tight batik sarong, with a black silk blouse known as a kebaya. My hair has been pulled back and tied into tight bun, a sanggul.

Everything in this palace, from the placement of trees to the movements made by the royal court, has meaning.

In Javanese culture, things are not said directly, but instead conveyed by symbolism.

The sultan, who is 72, recently changed his own title so that it is gender neutral and has given his eldest daughter the new name Gusti Kanjeng Ratu Mangkubumi - which means The One Who Holds the Earth.

That was seen as further indication she is being lined up to take over the throne when the time comes.

The princess laughs when I say her title holds a lot of responsibility.

"As in all families, as the eldest I have more responsibility than my sisters. But what the future holds, that decision is the hands of my father," she says with a smile.

She rarely talks publicly about succession and is careful with her words.

"I have been raised not to dream about those things, or hold wishes beyond living a happy life now."

But she adds: "There have been queens in Aceh and in other Islam kingdoms, that's all I need to say."

Image caption Princess Mangkubumi has been given the title The One Who Holds the Earth

Her younger sister, Gusti Kanjeng Ratu Hayu, is bolder in speaking about the unprecedented power the princesses have been given.

They were all sent overseas to study in Europe, America and Australia and now hold various leadership positions in the palace that were once the domain of men.

"I am very lucky to have parents that never said that is not a woman's job," she says in fluent English.

"It doesn't sit well with some people but when the sultan says so, you kind of have to go along with it," she laughs.

"That's the importance of a man saying that it's not the time for women to stay back any more."

'They will be evicted'

The sultan's brothers and sisters are not going along with it. They are outraged and most of them, like GBPH Prabukusumo, are now refusing to speak with the sultan or attend royal events.

"We are an Islamic royal family and the title is for a man. What would we call her - the sultante? It's impossible," he laughs.

Image caption The sultan's siblings are no longer talking to him or attending royal events

He says the move is a dangerous break with hundreds of years of tradition and accused his brother's family of being power-hungry and greedy.

And he sends a strong warning about what will happen.

"We have made a family commitment that we will not fight now, but when the sultan has left this world, we have an agreement with the people that we will drive his wife and his daughters out of the palace."

"They will be evicted, as they are no longer members of our family," he says.

That would create quite I stir, I say.

"That's OK, just remember who is in the wrong here."

Two queens?

Outside the palace walls most people are reluctant to take sides, saying they will accept the decision of the royal family.

Image caption There is concern about what the Queen of the South Sea will think of a female monarch

But among the devoted followers there is concern about what the Queen of the South Sea will think.

You might also be interested in:

The Javanese royal rule stretches back to the 16th Century and while the family is now Muslim like most Indonesians, the rituals they carry out are steeped in mysticism, a product of Hinduism, Buddhism and animism of the past.

And tradition has it that the Sultan of Yogyakarta has to take the goddess Kanjeng Ratu Loro Kidul as his mystical wife.

"There is a vow between the sultan and the Queen of the South Sea Loro Kidul that has been written down in our sacred text, that together they will rule and keep the peace," explains the Sultan's brother GBPH Yudaningrat.

Fingernail clippings and locks of the sultan's hair are offered to the sea goddess every year. They are also offered to the ogre Sapu Jagat inside Mount Merapi, one of Indonesia's most active volcanoes that looms over the city.

Image caption Rituals in the palace are carried out in the same way they have been for hundreds of years

The offerings and spiritual union are meant to ensure the sacred alignment between the volcano, the palace in the middle, and the Indian Ocean, and thus the safety of the people.

"What will happen if there are two queens? How can they be together? I am not sure that can happen," asks Agus Suwanto, a tour guide outside the palace.

That's a good question and a good point, smiles Wedono Bimo Guritno, the palace guide, when I ask him.

"The sultan's role is to keep both the goddess of the south sea and the god of the volcano in balance. Some people forget about the volcano, god. I am sure the sultan will make a wise decision for the people of Yogyakarta."

Challenging times

The Sultan of Yogyakarta also has to make decisions about more earthly matters as the governor of the city and the surrounding area.

When Indonesia gained independence, Jakarta allowed the Yogyakarta royal family to keep its power, out of gratitude for their role in fighting the colonial Dutch rulers.

So Yogyakarta is the only place in Indonesia where residents don't get to directly elect their leader. When it was suggested by Jakarta that this should change in 2010 there were angry protests on the streets of Yogyakarta and the central government backed down.

Image copyright Getty Images Image caption The Sultan of Yogyakarta is the last in Indonesia with real political power.

But Sultan Hamengkubuwono X has been a controversial modern leader with wide ranging political and business ambitions.

When Mount Merapi started erupting in 2006 he told villagers to listen to scientists rather than the palace-appointed gatekeeper of the volcano about when to evacuate.

And some in Yogyakarta accuse him of turning this cultural, once sleepy, capital into a city of shopping malls, billboards and high-rise buildings.

Mystic Islam

These are challenging times for Java's unique moderate, mystical form of Islam that the Sultan and the Kraton represents.

Image copyright Getty Images Image caption Sultan Hamengkubuwono X is a prominent moderate Islamic leader.

Veneration of objects or idols, and hints to polytheism, run in conflict with the Wahhabis strain of Islam that is growing in popularity in Java.

"I run the social media pages for the palace and I see this conservative view," says Princess Gusti Hayu.

"But we have reasons why we carry out rituals here the way we do and it might not be exactly the same as in the Koran but we don't stray, we don't do weird cult things," she laughs.

Image copyright Getty Images Image caption Princess Haryu says opening up the palace is the only way for the culture to survive

"This is an Islamic kingdom, it's not about walking around looking like someone from the Middle East and just sounding very religious. Islam is woven into everything we do daily."

She says past royal families took pride in being exclusive and being shrouded in mysticism, but that the way to survive is to open the palace up.

"So the young don't lose touch with their Javanese side because if we lose our cultural identity it's not going to come back."

Despite an increasing number of young Javanese Muslim women now choosing to wear the headscarf, hijabs are not allowed in the palace.

"Lots of women who wear the headscarf take it off when they enter the Kraton for rituals, voluntarily, and put it on again when they leave," says the Queen Gusti Kanjeng Ratu Hemas .

"This is not about religion, it's about protecting our culture and tradition and society understands that. The Sultan is above all religions."

But this is increasingly a provocative stance to take in today's Indonesia.

Recently the daughter of Indonesia's first President Sukarno, Sukmawati, was reported to the police for blasphemy and forced to apologise for saying in a poem that the Javanese hairbun was more beautiful than a Islamic chador.

Image caption Queen Gusti Kanjeng Ratu Hemas is accused by the Sultans family of leading the revolt.

The sultan's extended family accuses the queen, who is a senator in the national parliament, of leading the revolt against tradition.

She says she raised her daughters to be independent and to believe they were equal to men.

"When my daughters were 15 years I told them they had to leave the palace, to get educated in the world, to bring back what they learnt."

Grooming them for leadership? I ask.

That decision is in the hands of the sultan, she says firmly.

"But, yes, the heir has to be the bloodline, so there is no need for you to dig deeper."

"There will always be conflict and power struggles at times of change," she adds.