Surgery doesn't change the chromosomes. Even a 'post op' would still legall be a male. However I think there was one recent Australian case where someone was successful in changing their gender legally.
Marriage Amendment Act doesn't define gender by chromosomes, but by 'gender markers' if I remember correctly.
Australians can also have their birth certificates and other forms of identification changed to reflect the new gender. From the 'highly' reputable source of wiki:
http://en.wikipedia.org/wiki/Legal_aspects_of_transsexualism#Australia