private static XElement ConvertToXml(MongoStoredKey element)
        {
            element.Validate();
            var result = XElement.Parse(element.Xml);

            return(result);
        }
        public void StoreElement(XElement element, string friendlyName)
        {
            var keyElement = new MongoStoredKey
            {
                Xml          = element.ToString(SaveOptions.DisableFormatting),
                FriendlyName = friendlyName
            };

            keyElement.Validate();
            Collection.InsertOne(keyElement);
        }