private bool PrepareTestNGXmlForExecution()
        {
            TestNGSuiteXML customizedSuiteXML = null;

            try
            {
                switch (ExecutionMode)
                {
                case eExecutionMode.XML:
                case eExecutionMode.FreeCommand:
                    //Parameters
                    if (TestNgSuiteXMLObj != null && TestngXmlParametersToOverwrite != null && TestngXmlParametersToOverwrite.Count > 0)
                    {
                        General.AddInfoToConsole("Create Custom TestNG Xml for Execution");
                        customizedSuiteXML = new TestNGSuiteXML(TestngXmlPath);
                        customizedSuiteXML.OverrideXMLParameters(TestngXmlParametersToOverwrite);
                    }
                    break;
                }

                //create temp XML
                if (customizedSuiteXML != null)
                {
                    General.AddInfoToConsole("Save Custom TestNG Xml for Execution");
                    if (OverwriteOriginalTestngXml)
                    {
                        customizedSuiteXML.SuiteXml.Save(TestngXmlPath);//overwrite original TestNG xml
                        TestNgSuiteXMLObj = new TestNGSuiteXML(TestngXmlPath);
                        General.AddInfoToConsoleAndAction(GingerAction, String.Format("The Parameters of '{0}' TestNG XML were overwritten", TestngXmlPath));
                    }
                    else
                    {
                        string customeXMLFilePath = Path.Combine(TempWorkingFolder, "Custom " + Path.GetFileName(TestngXmlPath));
                        customizedSuiteXML.SuiteXml.Save(customeXMLFilePath);
                        mOriginalTestngXmlPath = TestngXmlPath;
                        TestngXmlPath          = customeXMLFilePath;
                        TestNgSuiteXMLObj      = new TestNGSuiteXML(TestngXmlPath);
                        General.AddInfoToConsoleAndAction(GingerAction, String.Format("Customized TestNG XML path: '{0}'", TestNgSuiteXMLObj.XmlFilePath));
                    }
                }
                else
                {
                    General.AddInfoToConsole("TestNG Xml customization is not needed");
                }
                return(true);
            }
            catch (Exception ex)
            {
                General.AddErrorToConsoleAndAction(GingerAction, string.Format("Failed to Prepare TestNG Xml for execution, Error is: '{0}'", ex.Message));
                return(false);
            }
        }