It is possible for identical twins to be of opposite sexes it is just beyond incredibly rare and would require a chromosomal anomaly within the egg being fertilized in which it would have an extra X chromosome. Since identical twins are defined by being monozygotic, the zygote (i.e. fertilized egg) formed from an abnormal egg with an extra X chromosomes would have XXY chromosomes which could in turn split to form the twin zygotes, one retaining the XX chromosomes and the other the XY, which would result in identical twins of different sexes.
