/// <summary>
        /// Add new user
        /// </summary>
        /// <param name="firstname"></param>
        /// <param name="lastname"></param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="isEncrypted"></param>
        /// <returns></returns>
        public bool addNewEndUser(string firstname, string lastname, string userName, string password, bool isEncrypted)
        {
            EndUser   endUser = new EndUser(firstname, lastname, userName, password, isEncrypted);
            XDocument xmlDoc  = XDocument.Load(path + @"\EndUsers.xml");

            xmlDoc.Elements("EndUsers").First().Add(
                new XElement("EndUser", new XAttribute("isPasswordEncrypted", endUser.PasswordEncrypted),
                             new XElement("username", endUser.UserName),
                             new XElement("password", endUser.Password),
                             new XElement("firstname", endUser.Firstname),
                             new XElement("lastname", endUser.Lastname)
                             )
                );
            xmlDoc.Save(path + @"\EndUsers.xml");
            return(true);
        }
        /// <summary>
        /// remove exisitng user
        /// </summary>
        /// <param name="firstname"></param>
        /// <param name="lastname"></param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="isEncrypted"></param>
        /// <returns></returns>
        public bool removeEndUser(string firstname, string lastname, string userName, string password, bool isEncrypted)
        {
            EndUser   endUser         = new EndUser(firstname, lastname, userName, password, isEncrypted);
            XDocument xmlDoc          = XDocument.Load(path + @"\EndUsers.xml");
            var       elementToDelete = from elem in xmlDoc.Elements("EndUsers").Elements("EndUser")
                                        where elem != null &&
                                        elem.Element("username").Value.Equals(endUser.UserName) &&
                                        elem.Element("password").Value.Equals(endUser.Password)
                                        select elem;

            foreach (var e in elementToDelete)
            {
                e.Remove();
            }
            xmlDoc.Save(path + @"\EndUsers.xml");
            return(true);
        }
        // string path = HttpRuntime.AppDomainAppPath + "/DataAccessLayer/Database/";

        /// <summary>
        /// setup initial users db
        /// </summary>
        public void setupEndUserDB()
        {
            //encrypted string for "password"
            EndUser [] endUsers = new EndUser[] {
                new EndUser("test", "user1", "testUser1", "pYyzmOe/wmh5Rpu+dwwK8Q==", true),
                new EndUser("test", "user2", "testUser2", "pYyzmOe/wmh5Rpu+dwwK8Q==", true)
            };

            IEnumerable <XElement> xml = from endUser in endUsers
                                         select new XElement(
                "EndUser", new XAttribute("isPasswordEncrypted", endUser.PasswordEncrypted),
                new XElement("username", endUser.UserName),
                new XElement("password", endUser.Password),
                new XElement("firstname", endUser.Firstname),
                new XElement("lastname", endUser.Lastname)
                );

            //create new xml doument
            XElement xmldoc = new XElement("EndUsers", xml);

            xmldoc.Save(path + @"\EndUsers.xml");
        }