Creates an XML encoding of the security object and its current state, using the specified policy level context.
- level
- The System.Security.Policy.PolicyLevel context for resolving System.Security.NamedPermissionSet references.
A System.Security.SecurityElement that contains the XML encoding of the security object, including any state information.
The policy level context is provided for resolution of named permission set references. For example, code groups use policy level to find named permission sets.