I'm far from an expert myself but I've made some female troops for certain factions, I made a new xml for my troops called spnpccharacters_female, then defined the troops in it by copying and edting troops from the sandbox xmls, example
<NPCCharacters>
<NPCCharacter id="sturgian_recruit_female" default_group="Infantry" level="4" civilianTemplate="NPCCharacter.sturgia_troop_civilian_template_t1" name="{=BBJKgKj2}Sturgian Fighter Woman" occupation="Soldier" is_basic_troop="true" culture="Culture.sturgia" is_female="true">
<face>
<face_key_template value="NPCCharacter.villager_sturgia" />
</face>
<skills>
<skill id="Athletics" value="20" />
<skill id="Riding" value="5" />
<skill id="OneHanded" value="20" />
<skill id="TwoHanded" value="10" />
<skill id="Polearm" value="20" />
<skill id="Bow" value="5" />
<skill id="Crossbow" value="0" />
<skill id="Throwing" value="10" />
</skills>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.nordic_padded_cloth" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Head" id="northern_fur_cap" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.nordic_padded_cloth" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Gloves" id="Item.ragged_armwraps" />
<equipment slot="Head" id="nordic_fur_cap" />
<equipment slot="Cape" id="Item.scarf" />
</equipmentSet>
<equipmentSet>
<equipment slot="Item0" id="Item.sturgia_axe_2_t2" />
<equipment slot="Body" id="Item.northern_leather_vest" />
<equipment slot="Leg" id="Item.highland_leg_wrappings" />
<equipment slot="Head" id="nordic_fur_cap" />
</equipmentSet>
<upgrade_targets></upgrade_targets>
</NPCCharacter>
add your next tier troop in the upgrade targets.
I've made a module folder with submodule.xml as per other tutorials then included my xml in it by adding this
<Xmls>
<XmlNode>
<XmlName id="NPCCharacters" path="spnpccharacters_female" />
<IncludedGameTypes>
<GameType value="Campaign" />
<GameType value="CampaignStoryMode" />
<GameType value="CustomGame" />
</IncludedGameTypes>
</XmlNode>
I added them to my game in NPC parties with party templates, with mixed success (I have my own question thread) Not sure the best way how to make them recruitable other than replacing a kingdoms default troop with them in Spcultures.xml, I havent messed with that I just wanted them showing up occasionally in NPC armies.