public XmlDocument Execute(string QueryID, string SortBy, string StartRecord, string MaxRecords)
        {
            XmlDocument rtn = new XmlDocument();
            try
            {
                DataIO search = new DataIO();
                XmlDocument returndata = new XmlDocument();
                _doc.LoadXml(search.GetQueryXML(QueryID));

                if (_doc == null)
                {
                    _doc = new XmlDocument();
                    _doc.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "/Search/Utilities/GetPersonListWithQueryID.xml");
                    this.LoadQueryID(QueryID);
                    this.LoadOutputOptions(SortBy, StartRecord, MaxRecords);
                }
                else
                {

                    this.SetPages(StartRecord, MaxRecords);
                    this.SetSort(SortBy);
                }

                //TODO: ZAP: Sometimes the personid gets cached if its a connection search of a keyword.
                if (_doc.SelectSingleNode("Profiles/QueryDefinition/PersonID") != null)
                {
                    _doc.SelectSingleNode("Profiles/QueryDefinition/PersonID").InnerText = "";
                }

                returndata = search.BetaSearch(_doc);

                this.QueryID = QueryID;

                CacheWrapper.CacheItem(QueryID + "request", _doc);
                CacheWrapper.CacheItem(QueryID + "results", returndata);
                rtn = returndata;
            }
            catch (Exception ex)
            {
                //For Debugging only put a break(F9) on the ex=ex while debugging,  if an error takes place at this level then the cache for the query header has
                // exprired so notify the user and have them start a new search session.
               Framework.Utilities.DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);

            }

            return rtn;
        }