/// <summary>
        /// Creates the membership from internal user.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <returns></returns>
        private MembershipUser CreateMembershipFromInternalUser(XmlUser user) {

            return (user != null)
                ? new MembershipUser(this.Name,
                    user.UserName, user.UserKey, user.Email, user.PasswordQuestion,
                    user.Comment, user.IsApproved, user.IsLockedOut, user.CreationDate, user.LastLoginDate,
                    user.LastActivityDate, user.LastPasswordChangeDate, user.LastLockoutDate)
                : null;
        }
        /// <summary>
        /// Adds a new membership user to the data source.
        /// </summary>
        /// <param name="username">The user name for the new user.</param>
        /// <param name="password">The password for the new user.</param>
        /// <param name="email">The e-mail address for the new user.</param>
        /// <param name="passwordQuestion">The password question for the new user.</param>
        /// <param name="passwordAnswer">The password answer for the new user</param>
        /// <param name="isApproved">Whether or not the new user is approved to be validated.</param>
        /// <param name="providerUserKey">The unique identifier from the membership data source for the user.</param>
        /// <param name="status">A <see cref="T:System.Web.Security.MembershipCreateStatus"></see> enumeration value indicating whether the user was created successfully.</param>
        /// <returns>
        /// A <see cref="T:System.Web.Security.MembershipUser"></see> object populated with the information for the newly created user.
        /// </returns>
        /// <exception cref="T:System.ArgumentNullException">Thrown when username is <c>null</c></exception>
        public override MembershipUser CreateUser(
            string username,
            string password,
            string email,
            string passwordQuestion,
            string passwordAnswer,
            bool isApproved,
            object providerUserKey,
            out MembershipCreateStatus status) {

            if (username == null)
                throw new ArgumentNullException("username");

            try {
                bool valid = this.VerifyUserIsValid(
                    providerUserKey, username, password, email, passwordQuestion, passwordAnswer, out status);

                if (valid) {
                    // user date is valid then create
                    DateTime now = this.UseUniversalTime ? DateTime.UtcNow : DateTime.Now;
                    string salt = string.Empty;
                    string encodedPassword = this.EncodePassword(password, ref salt);

                    var userKey = (providerUserKey != null) ? (Guid)providerUserKey : Guid.NewGuid();
                    XmlUser user = new XmlUser {
                        UserKey = userKey,
                        UserName = username,
                        PasswordSalt = salt,
                        Password = encodedPassword,
                        Email = email,
                        PasswordQuestion = passwordQuestion,
                        PasswordAnswer = passwordAnswer,
                        IsApproved = isApproved,
                        CreationDate = now,
                        LastActivityDate = now,
                        LastPasswordChangeDate = now
                    };

                    lock (SyncRoot) {
                        // Add the user to the store
                        this.Store.Users.Add(user);
                        this.Store.Save();
                    }

                    return CreateMembershipFromInternalUser(user);
                }
                else {
                    return null;
                }
            }
            catch {
                throw;
            }
        }