Changing DataTemplate based on Attribute in an XElement
===

Ok I have an XElement that looks like:

    <authentication mode="Forms">
      <forms loginUrl="login.aspx" name=".LOGIN" protection="All" timeout="4800" path="/" />
    </authentication>

Then in my XAML I setup a ContentControl that looks like:

    <ContentControl Content="{Binding Data}">
            <ContentControl.ContentTemplate>
                <DataTemplate>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=Attribute[mode].Value}" Value="Forms">
                            <Setter Property="ContentTemplate" Value="{StaticResource FormsTemplate}"/>                            
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ContentControl.ContentTemplate>
        </ContentControl>

Where Data is my public property that contains the XElement. My template looks like:

    <DataTemplate x:Key="FormsTemplate">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Login URL"/>
                    <TextBox Text="{Binding Path=Element[forms].Attribute[loginUrl].Value}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Name"/>
                    <TextBox Text="{Binding Path=Attribute[name].Value}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Protection"/>
                    <TextBox Text="{Binding Path=Attribute[protection].Value}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Timeout"/>
                    <TextBox Text="{Binding Path=Attribute[timeout].Value}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Path"/>
                    <TextBox Text="{Binding Path=Attribute[path].Value}"/>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
        <DataTemplate DataType="passport">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Redirect URL"/>
                    <TextBox Text="{Binding Path=Attribute[redirectUrl].Value}"/>
                </StackPanel>                
            </StackPanel>
        </DataTemplate>

Why doesn't this work? Nothing shows up on the screen when I do this.