public void LoadRealmState( XElement el ) { XAttribute temp; if ( ( temp = el.Attribute( "IsRealm" ) ) != null ) { bool isRealm; if ( bool.TryParse( temp.Value, out isRealm ) ) { IsRealm = true; } } }