One of the earliest written versions of this very old story in China seems to be a brief ballad, which you may wish to read first. Link
HUÀ Mùlán 华木兰 = a filial daughter with a tomboy streak
(NB: as a surname, 华 is pronounced huà, not huá.)
Her fragile father, mother, and younger siblings
JĪN Yǒng 金勇 = her sworn brother, a general
Long ago in a village far in the north there lived a girl named HUÀ Mùlán 华木兰 (Magnolia).
One day, as Mùlán was sitting working at her loom, her mother heard her suddenly burst into sobs. When she came to see what was the matter, Mùlán responded, “Nothing.” But when her mother persisted, Mùlán admitted that she had seen a poster in the market calling for soldiers to defend against an invasion. There were twelve rolls of names of household heads, each including that of Mùlán’s father as head of the household.
Mùlán’s father was too old and weak to be a soldier. However he had no grown-up son to send in his place, for Mùlán was his only adult child.
Mùlán resolved to buy a saddle and horse and go to fight in place of her old father, as though she were a son. So she went and bought these things, as well as arms and armor. Of course, since only men could go and fight, she would also need to disguise herself as a man.
At dawn she dressed in new manly clothes, donned her armor, bid farewell to her parents and her younger sister and brother, and headed off to join other new recruits to go to war.
Nightfall found them camped on the banks of the Yellow River, and its gentle splashing sounded to her like her mother softly calling her name. By the evening of the second day they had reached Black Mountain (Hēishān 黑山), where she thought the neighing of the horses far off in the enemy camp sounded like her father’s voice calling out to her.
In time, Mùlán rode many miles and fought many battles, crossing mountain passes, and living in rough military camps. But she was buoyed by the thought of her father safe at home.
The war raged on for ten years, as soldiers and generals lost their lives in large numbers. Mùlán herself was a good warrior and rose in the ranks. After ten years, she finally returned in victory, hailed as the savior of the state.
Summoned to an audience with the emperor, she was praised for her courage and leadership in battle, and rewarded with high titles and gifts, and offered any reward she desired. She replied that all she wanted was a strong camel to take her back to her old home. Her wish was granted, and she headed home with many attendants and army comrades.
When the group arrived at Mùlán’s home, her parents were overjoyed. Her sister donned festive clothes and her brother sharpened his ax to slaughter a pig and a sheep for a feast.
Retiring to her old bedroom, Mùlán removed her armor, changed back to a dress, left behind a decade ago, brushed our her hair, and put a garden flower into it.
Her attendants were shocked to see her as a woman. “How could we have fought beside her for ten long years and not known she was a woman?!” they asked each other in wonder.
Mùlán replied, “A male rabbit hops, while a female rabbit sits still, but in time of danger they both run away, and who cares which is which?”
[The basic story as recounted above is sometimes modified to provide a much more pronounced love interest. For example, a Běijīng opera version made for film “HUÀ Mùlán” (winner of the China’s 1994 Huábiǎo Award 华表奖 and 1995 Golden Rooster award 金鸡奖 for Best Musical) presents a somewhat different tale:]
HUÀ Mùlán 华木兰 is presented with a sword by her father and, disguised as a young man, is dispatched with her family’s blessing to serve in the army in place of her father. She becomes the companion of general JĪN Yǒng 金勇, with whom she swears an oath of brotherhood, but with whom she begins to fall in love. Huà Mùlán distinguishes herself in battle, becomes a general —General Huà— and is much loved and respected by her troops.
Eventually she is wounded in battle, and the maid assigned to nurse her back to health falls in love with the young warrior. Indeed, the maid’s flirting becomes more overt each day. To avoid the awkwardness (and possible suicide of the love-struck maid), Mùlán reveals that she is female, and they fall into each other’s arms in tears that they are both separated by fate from true love: the maid knows fate has torn her from General Huà, who can never marry her because they are both female, and wrongly imagines that Mùlán is heartbroken for the same reason, although of course we know that Mùlán’s grief is founded in being unable to wed General Jīn, who thinks she is male and is her sworn “brother.”
They are interrupted in their operatic lamentations by a visit from General Jīn, who is chastises Mùlán for dallying with a maid rather than returning to the front. The maid, seeking to clarify the same-sex innocence of Mùlán’s embrace, reveals that Mùlán is female.
The remainder of the opera centers upon Mùlán and General Jīn struggling with their feelings for each other compared to their sense of patriotic duty and the necessity of protecting Mùlán’s secret; they finally agree to be married when the war is over.
The definitive battle is fought and the enemy soundly defeated, but General Jīn is killed. The film ends with Mùlán, now dressed as a woman, sobbing an aria on his grave. However, knowing that he died in defense of Glorious China, she knows that he died nobly, and she resolves to revisit the grave yearly. As she sobs, she is interrupted by the soldiers, who are astonished to find her female, but who remain loyal to her.
A herald from the emperor arrives to summon her to receive the title Marquis (hóu 侯) and grant her a wish. She writes a huge patriotic scroll to return to the emperor. Returning to the original story line, her only wish is to return home, where she is greeted by her delighted family.