In comic theatre and film, people often use a man for a woman's part, or a woman for a man's part - this has a long history. Most of Shakespeare's comedies have examples of this. Both Dustin Hoffman and Robin Williams were in popular comedy films where they played most scenes as men in women's clothes, pretending to be women.