TOKYO -- On June 29, a demure graduate student will enter a sacred shrine inside Tokyo's moat-encircled imperial palace grounds, drink special rice wine from a shallow lacquered cup and become a princess.

The impending marriage of Kiko Kawashima, daughter of a university professor and descendant of a carpenter, to Prince Aya, descendant of the sun goddess Amaterasu and second in line to Japan's Chrysanthemum Throne, is as close to a Cinderella story as real life gets.

But if experience is any guide, her passage from commoner into the cloistered world of jealous aristocrats and snooty chamberlains won't be easy. Some of those retainers, not happy that the granddaughter of a masseur might become mother of an emperor, tried to block the marriage, sources say. Only when Aya, 24, threatened to leave the imperial family if he could not marry his true love did they back down.

Without a fairy godmother to ease her transformation, Kiko-san -- as Japan's adoring press has dubbed her -- spent a month under the tutelage of the severe and secretive Imperial Household Agency, receiving guidance in matters both arcane and practical.

In formal, one-on-one classes with top university professors and aged imperial servants, the princess-to-be has learned to write waka, the sparse, ancient poetry that imperial family members are expected to pen and submit to the emperor every month. She also has been tutored in calligraphy, the intricacies of Japan's nature-worshiping Shinto religion and the role of the emperor and his family throughout history and today.

Japanese princesses also are expected to speak at least one foreign language, and the imperial training course has always focused on that skill for past princesses-to-be. But in Kiko's case, she was able to skip language instruction because she already can converse comfortably in English and German from having lived abroad as a child and studying languages in school.

"These are very formal lessons given to all new princesses. What it teaches is the basic mental position needed to become a member of the imperial family," said Kenji Maeda, director of general affairs for the Imperial Household Agency.

Similarly, the emperor's 21-year-old daughter, Princess Nori, eventually will receive informal schooling on life as a commoner. When she marries she will lose her status as a royal and, like past emperors' daughters, will probably be shown how to shop, clean and run a household.

Kiko also has been getting measured for her new wardrobe, including the 12-layer, Heian-style, dark wedding dress favored by the imperial family for about the past 1,000 years, and her imperial jewelry -- the tiara, necklace, earrings and ring she will wear as a princess.

More informally, imperial family-watchers report, the 23-year-old Kiko has been meeting discreetly with her future mother-in-law, Empress Michiko, who 31 years ago was the first commoner to marry into the imperial family and who reportedly suffered a nervous breakdown at one point from the strain.

It is said that Michiko's mother-in-law, now the ailing empress dowager, repeatedly shunned her, and old-line aristocrats in the Imperial Household Agency unrelentingly gave her a hard time. Michiko at least had the advantage of coming from a wealthy and socially high-ranking family, with the consequent familiarity with aristocratic ways: servants, large quarters, bountiful wardrobes and plenty of money.

Nothing could be further from Kiko's experience. She and her brother and parents live in a small, four-room unit of a cement apartment block on the campus of Gakushuin University, where she and Aya met and where her father teaches economics. When a formally clad imperial messenger visited the Kawashimas May 11 to inform them that the royal nuptials would be June 29, the family put up a gold screen and set out a table with a fancy flower arrangement on it in an effort to provide a loftier setting for the much-photographed event.

None of Kiko's ancestors is famous or particularly rich, and some were so low-born as to make the crusty imperial family protectors decidedly uncomfortable, sources say: her grandfather the masseur, for example, who handled neighborhood back pains, and her great-grandfather the furniture maker.

There is much speculation here about how a family as modest as the Kawashimas can afford a princess daughter, with her lifelong need for fine clothes and jewelry, which traditionally a princess's family would be expected to buy. It is possible the emperor will help or that Kiko's grandmother will sell a small but, given Tokyo's sky-high land prices, very valuable house she owns, according to Toshiaki Kawahara, an expert on the imperial family.

In the old days, "Kiko-san would have had no chance to become a princess," said Kawahara, who has written several books on the family. Before 1945 only aristocrats of a certain standing could marry into the emperor's line. But with Japan's defeat in World War II (and under pressure from American occupation authorities) the imperial family decided to democratize. Thus Crown Prince Akihito -- now emperor -- was allowed to marry Michiko Shoda, daughter of an affluent businessman.

While the public has cheered the idea that someone from as humble a background as Kiko's could one day become empress (if something were to happen to Crown Prince Naruhito, first in line to the throne), or produce the next emperor (if Naruhito, who has not yet found a wife, were to have no male heirs), it sends shudders through the ranks of stuffy imperial handlers, Kawahara said.

"The gap of family status is too wide," he said. "In Michiko's case, she was not an aristocrat, but her family was as old as the aristocracy, it had tradition and it had wealth, so it was substantially equivalent to the aristocracy."

It is the status gap that Kawahara suggested will make life extremely difficult for Kiko in the beginning. Because the imperial family leads a very restricted life, aloof from the public, she will have few opportunities to see her family or friends. According to Kawahara, Michiko has gone "to her own country," the Japanese expression for returning to her parents' home, fewer than 20 times since her marriage in April 1959. And inviting people -- even good friends -- to the imperial grounds is a rather formal affair.

In the beginning there will undoubtedly be some missteps. While the Imperial Household Agency made sure Kiko was tutored in the essentials, most of her training will occur on the job. There will be ample opportunity for that. Until their own residence inside the imperial family compound is built, Prince Aya and Kiko will live in a small wooden building, once quarters for imperial household staff, and will have seven staff members living nearby to attend them.

Learning how to act, dress and talk like a princess, said Maeda of the Imperial Household Agency, "is not part of the formal lessons, but something she will absorb more naturally in her daily encounters with the imperial family." A daunting prospect perhaps. But, said Maeda, "I think she fully recognizes that her life is about to change quite dramatically."