JST XH 3 are also usually found with most 3 pin Lithium Polymer battery connectors. Use this to replace or rewire similar devices.
JST XH 3-Pin Battery Connector pigtail set with female cable end and PCB-mount male jack.
Did you know that the ultimate gender of any plug/socket device is the shape of the centermost terminal? The outside shape doesn't matter; it's the shape of the final, final pin that determines what is male or female. In this case, the cable side housing is male, but since the housing holds female ends (sockets), we refer to it as the female connector.