public override SecurityElement ToXml()
        {
            SecurityElement e = PermissionHelper.Element(typeof(DataProtectionPermission), version);

            e.AddAttribute("Flags", _flags.ToString());
            return(e);
        }
        //
        // FromXml/ToXml
        //

        public override SecurityElement ToXml()
        {
            SecurityElement securityElement = new SecurityElement("IPermission");

            securityElement.AddAttribute("class", this.GetType().FullName + ", " + this.GetType().Module.Assembly.FullName.Replace('\"', '\''));
            securityElement.AddAttribute("version", "1");
            if (!IsUnrestricted())
            {
                securityElement.AddAttribute("Flags", m_flags.ToString());
            }
            else
            {
                securityElement.AddAttribute("Unrestricted", "true");
            }
            return(securityElement);
        }