Your gender is written in your chromosomes and you cannot change that.
I hate to break it to you but gender and the sex of your body are two completely separate things. Gender is like self expression, it's a social construct or roles that we use to better define and align ourselves. Gender also breaks down into gender presentation (how you present yourself), gender identity (how you feel) and so on. Looking beyond the catholic western societies, there are other ones out there that have more than just the typical male and female genders, the idea of there being more than two is absolutely nothing new.
Sex refers to your body's physical anatomy, this is something that can only be changed by surgery. Indeed your sex, at least until altered by means of surgery is determined by your chromosomes. Also, like gender there are more than two sexes, there are also intersex folk out there, however rare they may be.