XF 2.1 Templating issues

Hi I've recently been trying to build my first addon for XenForo 2.1 and I've started to hit a snag now that I'm writing up the templates for this addon

The first problem I am having is using <xf:dependant></xf:dependant> from the threads I was able to find it seems that you just put this inside the option that it is dependent on but once I do that I get a template error when I try to save it.
Line 138: Tag selectrow contains an unexpected child element. - Template name: admin:game_edit

The second issue im having is kinda similar to the first one as in the error is the same unexpected child element. I'm trying to run a foreach loop to populate a <xf:selectrow>.

<xf:if is="$server.isInsert()">
    <xf:title>{{ phrase('add_game') }}</xf:title>
<xf:else />
    <xf:title>{{ phrase('edit_game:') }} {$game.display}</xf:title>

<xf:pageaction if="$game.isUpdate()">
    <xf:button href="{{ link('game/delete', $game) }}" icon="delete" overlay="true" />

<xf:form action="{{ link('game/save', $game) }}" ajax="true" class="block">
    <div class="block-container">
        <div class="block-body">
            <xf:textarearow name="game_display" value="{$game.display}" autosize="true"
                label="The display name of the game"
                explain="" />
            <xf:selectrow name="protocol" value="{{$game.query_method}}" label="Query Method">
                <xf:option value="0" label="SourceQuery" />
                <xf:option value="1" label="GameQ" />
                        <xf:select name="game" value="{{$game.game}}" label="Game" data-hide="true">
                            <xf:option value="Aa3" label="Aa3" />
                            <xf:option value="Aapg" label="Aapg" />
                            <xf:option value="Arkse" label="Arkse" />
                            <xf:option value="Arma" label="Arma" />
                            <xf:option value="Arma3" label="Arma3" />
                            <xf:option value="Armedassault2oa" label="Armedassault2oa" />
                            <xf:option value="Armedassault3" label="Armedassault3" />
                            <xf:option value="Ase" label="Ase" />
                            <xf:option value="Atlas" label="Atlas" />
                            <xf:option value="Batt1944" label="Batt1944" />
                            <xf:option value="Bf1942" label="Bf1942" />
                            <xf:option value="Bf2" label="Bf2" />
                            <xf:option value="Bf3" label="Bf3" />
                            <xf:option value="Bf4" label="Bf4" />
                            <xf:option value="Bfbc2" label="Bfbc2" />
                            <xf:option value="Bfh" label="Bfh" />
                            <xf:option value="Brink" label="Brink" />
                            <xf:option value="Cod" label="Cod" />
                            <xf:option value="Cod2" label="Cod2" />
                            <xf:option value="Cod4" label="Cod4" />
                            <xf:option value="Codmw3" label="Codmw3" />
                            <xf:option value="Coduo" label="Coduo" />
                            <xf:option value="Codwaw" label="Codwaw" />
                            <xf:option value="Conanexiles" label="Conanexiles" />
                            <xf:option value="Contagion" label="Contagion" />
                            <xf:option value="Crysis" label="Crysis" />
                            <xf:option value="Crysis2" label="Crysis2" />
                            <xf:option value="Crysiswars" label="Crysiswars" />
                            <xf:option value="Cs15" label="Cs15" />
                            <xf:option value="Cs16" label="Cs16" />
                            <xf:option value="Cs2d" label="Cs2d" />
                            <xf:option value="Cscz" label="Cscz" />
                            <xf:option value="Csgo" label="Csgo" />
                            <xf:option value="Css" label="Css" />
                            <xf:option value="Dal" label="Dal" />
                            <xf:option value="Dayz" label="Dayz" />
                            <xf:option value="Dayzmod" label="Dayzmod" />
                            <xf:option value="Dod" label="Dod" />
                            <xf:option value="Dods" label="Dods" />
                            <xf:option value="Dow" label="Dow" />
                            <xf:option value="Eco" label="Eco" />
                            <xf:option value="Egs" label="Egs" />
                            <xf:option value="Et" label="Et" />
                            <xf:option value="Etqw" label="Etqw" />
                            <xf:option value="Ffe" label="Ffe" />
                            <xf:option value="Ffow" label="Ffow" />
                            <xf:option value="Gamespy" label="Gamespy" />
                            <xf:option value="Gamespy2" label="Gamespy2" />
                            <xf:option value="Gamespy3" label="Gamespy3" />
                            <xf:option value="Gamespy4" label="Gamespy4" />
                            <xf:option value="Gmod" label="Gmod" />
                            <xf:option value="Grav" label="Grav" />
                            <xf:option value="Gta5m" label="Gta5m" />
                            <xf:option value="Gtan" label="Gtan" />
                            <xf:option value="Gtar" label="Gtar" />
                            <xf:option value="Hl2dm" label="Hl2dm" />
                            <xf:option value="Http" label="Http" />
                            <xf:option value="Hurtworld" label="Hurtworld" />
                            <xf:option value="Insurgency" label="Insurgency" />
                            <xf:option value="Insurgencysand" label="Insurgencysand" />
                            <xf:option value="Jediacademy" label="Jediacademy" />
                            <xf:option value="Jedioutcast" label="Jedioutcast" />
                            <xf:option value="Justcause2" label="Justcause2" />
                            <xf:option value="Justcause3" label="Justcause3" />
                            <xf:option value="Killingfloor" label="Killingfloor" />
                            <xf:option value="Killingfloor2" label="Killingfloor2" />
                            <xf:option value="L4d" label="L4d" />
                            <xf:option value="L4d2" label="L4d2" />
                            <xf:option value="Lhmp" label="Lhmp" />
                            <xf:option value="Minecraft" label="Minecraft" />
                            <xf:option value="Minecraftpe" label="Minecraftpe" />
                            <xf:option value="Mohaa" label="Mohaa" />
                            <xf:option value="Mordhau" label="Mordhau" />
                            <xf:option value="Mta" label="Mta" />
                            <xf:option value="Mumble" label="Mumble" />
                            <xf:option value="Ns2" label="Ns2" />
                            <xf:option value="Pixark" label="Pixark" />
                            <xf:option value="Projectrealitybf2" label="Projectrealitybf2" />
                            <xf:option value="Quake2" label="Quake2" />
                            <xf:option value="Quake3" label="Quake3" />
                            <xf:option value="Quakelive" label="Quakelive" />
                            <xf:option value="Redorchestra2" label="Redorchestra2" />
                            <xf:option value="Redorchestraostfront" label="Redorchestraostfront" />
                            <xf:option value="Risingstorm2" label="Risingstorm2" />
                            <xf:option value="Rust" label="Rust" />
                            <xf:option value="Samp" label="Samp" />
                            <xf:option value="Serioussam" label="Serioussam" />
                            <xf:option value="Sevendaystodie" label="Sevendaystodie" />
                            <xf:option value="Ship" label="Ship" />
                            <xf:option value="Sof2" label="Sof2" />
                            <xf:option value="Soldat" label="Soldat" />
                            <xf:option value="Source" label="Source" />
                            <xf:option value="Spaceengineers" label="Spaceengineers" />
                            <xf:option value="Squad" label="Squad" />
                            <xf:option value="Starmade" label="Starmade" />
                            <xf:option value="Swat4" label="Swat4" />
                            <xf:option value="Teamspeak2" label="Teamspeak2" />
                            <xf:option value="Teamspeak3" label="Teamspeak3" />
                            <xf:option value="Teeworlds" label="Teeworlds" />
                            <xf:option value="Terraria" label="Terraria" />
                            <xf:option value="Tf2" label="Tf2" />
                            <xf:option value="Theforrest" label="Theforrest" />
                            <xf:option value="Tibia" label="Tibia" />
                            <xf:option value="Tshock" label="Tshock" />
                            <xf:option value="Unreal2" label="Unreal2" />
                            <xf:option value="Unturned" label="Unturned" />
                            <xf:option value="Urbanterror" label="Urbanterror" />
                            <xf:option value="Ut" label="Ut" />
                            <xf:option value="Ut2004" label="Ut2004" />
                            <xf:option value="Ut3" label="Ut3" />
                            <xf:option value="Ventrilo" label="Ventrilo" />
                            <xf:option value="Warsow" label="Warsow" />
                            <xf:option value="Won" label="Won" />
                            <xf:option value="Wurm" label="Wurm" />

        <xf:submitrow sticky="true" icon="save" />


I'm guessing this is just me not understanding something about how templates work in XenForo and is an easy fix so any help or pointers would be appreciate!