Custom code that extends security policy objects needs to implement the ISecurityPolicyEncodable.ToXml(System.Security.Policy.PolicyLevel) and ISecurityPolicyEncodable.FromXml(SecurityElement, System.Security.Policy.PolicyLevel) methods to make the objects security-encodable.