I assume it reads the gender from the gamedata file regardless of the recruitment status of the character. Changing the gender of one of the characters in the savefile (or changing their class to one of the opposite gender, as someone suggested somewhere; or doing both of those) using feftwiddler didn't unlock the paralogues for me. Using the "all paralogues unlocked" patch solves this and there's no need to change the genders in the gamedata file.
Then, in order for the game to recognize children of same-sex couples as siblings, once they've been both recruited, one of the children's data in the savefile should be hex-edited using feftwiddler so that both children have the same character id in the mother slot, and the other parent's id in the father slot (because when using this method, they're switched). UnassumingVenusaur came up with this alternative and described the process on her tumblr. To be honest, I prefer using this method since it's far simpler and quicker than hex-editing the gamedata file time and again.