Twelfth Night Adventure

A popular sub-genre of Gender Bender comedy (and increasingly, drama).

Our protagonist is a stranger trapped in a strange land. They need to infiltrate the social fabrics for one reason or another. Often, this reason is survival. Problem is, their true gender, if noticed, wouldn't allow them to blend in. Maybe they would be stuck in a ghetto or cage or breeding farm. Maybe they would be expelled. Maybe they would be killed...

But our protagonist does what they have to and becomes a Wholesome Crossdresser who will attempt to integrate themself into the setting. How well, and for how long, is what drives the plot.

As a rule, the establishment is draconian and ironclad in its traditions, and is more often than not militantly hateful towards the gender it excludes. Through his/her sensitivity, kindness and unique "outsider" perspective, our hero/heroine will (usually) challenge the preconceived and narrow perceptions of his/her fellow cast members...

...and with a little bit of luck, change the establishment into one of kindness and tolerance by the time his/her true gender is exposed.

Note if you're a Japanese male character on this adventure, you'll more often than not fall victim to the Gender Vocabulary Slip, as Japanese is a language with very gender-specific pronouns for men and women to refer to themselves with.

Compare Sweet Polly Oliver.

Anime and Manga

 * Ouran High School Host Club, in which our heroine Haruhi is talked into joining the club and masquerading as a wholesomely sweet boy to cater to their female clientele. It deviates from the usual formula in that her clubmates, at least, are fully aware of the ruse.
 * Also in that it's not really Haruhi (who simply has boyish tastes in clothing and hairstyle, and is entirely indifferent to what sex people think she is) trying to maintain the masquerade, but everybody around her.
 * I My Me! Strawberry Eggs started out as this, with the Hot-Blooded young teacher trying to prove the tyrannical Straw Feminist organisation's disdain of men wrong... only to fail bitterly.
 * Otome wa Boku ni Koishiteru is one of the funniest and most heartwarming examples in anime, wherein kind-hearted Wholesome Crossdresser Miyanokouji Mizuho becomes the most beloved "Onee-Sama" and a pillar of strength of his circle of friends in a Catholic Girl's School.
 * In Maria Holic, the crossdresser in question is actually not the main character. He is also apparently a cruel person who cares not one whit about other people.
 * In the first OVA of El Hazard, after finding himself in another dimension, the main character Makoto is forced to crossdress in order to pose as the missing princess Fatora.
 * The manga series Girl Got Game is about a high school girl named Kyo Aizawa who disguises herself as a boy in order to join Seisyu High's famous men's basektball team. However, it was her father's idea; she'd rather go to a normal school as a normal girl.
 * The manga series Mint na Bokura is about a boy whose twin sister transfers to a boarding school to be closer to the boy she has a crush on. He transfers to the same school because he doesn't want to be separated from her, but there's a catch: the boys' dorm is full, so he has to disguise himself as a girl and live in the girls' dorm.
 * In Hana Kimi, a Japanese-American girl wanted so much to meet her idol she decided to enroll the same school he attends. The problem is that he attends an all-boys school. He soon found out and started to like her. The plot point is that he doesn't know she likes him and she thinks he still doesn't know she's a girl.
 * The manga series AKB49: Ren'ai Kinshi Jourei is about an Ordinary High School Student cross-dressing to join an all-girl idol group so that he could secretly protect his crush, who is also in the same group.
 * In Marugoto Anju Gakuen, our protagonist is pretty much forced to join an all-girl academy for yokais by his mother.

Fan Works

 * Futari wa Pretty Cure Dragon has a male protagonist who winds up accidentally enrolling in a girls' school because he was trying to hard to pass an entrance exam after failing so many. The other protagonist is a girl through and through, and she finds out in the first episode right before they become the titular magical warriors.

Film

 * The truly Squick-tacular Wayan Brothers film White Chicks has two black male police officers masquerade as hideously ugly white valley-girls.
 * Amanda Bynes in She's the Man (which is a Setting Update of Twelfth Night) infiltrates an all boy's soccer team to prove that girls can play soccer just as well.
 * And two decades earlier, a girl infiltrates another high school's senior class as a boy to try to prove gender bias in her school's newspaper in Just One Of The Guys. The fact that her name was Terry didn't hurt. The funny part is, she failed miserably—turns out her writing to start with wasn't very good—but the Twelfth Night plot helped her to improve.
 * Disney's Mulan. This trope actually gave the family film some unexpected and refreshing parental bonuses.
 * Although one does notice that the character is drawn differently when she pretends to be a man. Look at the movie poster where half of her face is reflected in a sword. Notice her nose and jaw.
 * And apparently her eyebrows grew in no time.
 * Dustin Hoffman in Tootsie.
 * Yentl had this, as it was set during a time when women were not to become educated.

Literature

 * Tamora Pierce's Song of the Lioness series starts as a more dramatic example of this plot, though Alanna's gender gets revealed at roughly the halfway mark.
 * The male protagonist of A Planet Called Treason develops breasts due to a genetic disorder and parleys it into the opportunity to infiltrate an all-female society.

Theatre

 * Twelfth Night by Master William Shakespeare, obviously, created this Older Than Steam genre and named this trope.