Transcription factor that acts as a key regulator of spermatogenesis. Acts by regulating expression of genes required for the haploid phase during spermiogenesis, such as genes required for cilium assembly and function. Recognizes and binds the X-box, a regulatory motif with DNA sequence 5'-GTNRCC(0-3N)RGYAAC-3' present on promoters. Probably activates transcription of the testis-specific histone gene H1-6. Homodimer; probably only forms homodimers in testis. Heterodimer; heterodimerizes with RFX1 and RFX3. Mainly expressed in the nucleus and at lower level in cytoplasm. Belongs to the RFX family.