/// <summary>
        /// Converts to profile data objects.
        /// </summary>
        /// <returns></returns>
        private static ProductionProfile ConvertToProfileDataObjects(ProductionDetailsBEO m_BootParameters)
        {
            var profile = new ProductionProfile
            {
                DatasetId = m_BootParameters.Profile.DatasetId,
                DpnPrefix = m_BootParameters.Profile.DpnPrefix,
                DpnStartingNumber = m_BootParameters.Profile.DpnStartingNumber,
                HeaderFooterFontSelection = new ProductionSetHeaderFooterFont
                {
                    HeaderFooterColor = m_BootParameters.Profile.HeaderFooterFontSelection != null ? m_BootParameters.Profile.HeaderFooterFontSelection.HeaderFooterColor : null,
                    HeaderFooterFont = m_BootParameters.Profile.HeaderFooterFontSelection != null ? m_BootParameters.Profile.HeaderFooterFontSelection.HeaderFooterFont : null,
                    HeaderFooterFontSize = m_BootParameters.Profile.HeaderFooterFontSelection != null ? m_BootParameters.Profile.HeaderFooterFontSelection.HeaderFooterFontSize : null,
                    HeaderFooterHeight = m_BootParameters.Profile.HeaderFooterFontSelection != null ? m_BootParameters.Profile.HeaderFooterFontSelection.HeaderFooterHeight : 0,
                    HeaderFooterStyle = m_BootParameters.Profile.HeaderFooterFontSelection != null ? (FontStyles)m_BootParameters.Profile.HeaderFooterFontSelection.HeaderFooterStyle : FontStyles.Normal
                },
                ImageType = (ImageType)m_BootParameters.Profile.ImageType,
                IsBurnMarkups = m_BootParameters.Profile.IsBurnMarkups,
                IsIncludeArrowsMarkup = m_BootParameters.Profile.IsIncludeArrowsMarkup,
                IsIncludeBoxesMarkup = m_BootParameters.Profile.IsIncludeBoxesMarkup,
                IsIncludeHighlightsMarkup = m_BootParameters.Profile.IsIncludeHighlightsMarkup,
                IsIncludeLinesMarkup = m_BootParameters.Profile.IsIncludeLinesMarkup,
                IsIncludeReasonsWithMarkup = m_BootParameters.Profile.IsIncludeReasonsWithMarkup,
                IsIncludeRedactionsMarkup = m_BootParameters.Profile.IsIncludeRedactionsMarkup,
                IsIncludeRubberStampMarkup = m_BootParameters.Profile.IsIncludeRubberStampMarkup,
                IsIncludeTextBoxMarkup = m_BootParameters.Profile.IsIncludeTextBoxMarkup,
                IsInsertPlaceHolderPage = m_BootParameters.Profile.IsInsertPlaceHolderPage,
                IsOneImagePerPage = m_BootParameters.Profile.IsOneImagePerPage,
                IsPrintDCNInPlaceHolderPage = m_BootParameters.Profile.IsPrintDCNInPlaceHolderPage,
                IsPrintDPNInPlaceHolderPage = m_BootParameters.Profile.IsPrintDPNInPlaceHolderPage,
                LeftFooter = new ProductionSetHeaderFooter
                {
                    DatasetFieldSelected = m_BootParameters.Profile.LeftFooter.DatasetFieldSelected,
                    IsIncrementNeededInText = m_BootParameters.Profile.LeftFooter.IsIncrementNeededInText,
                    Option = (HeaderFooterOptions)m_BootParameters.Profile.LeftFooter.Option,
                    TextPrefix = m_BootParameters.Profile.LeftFooter.TextPrefix,
                    TextStartingNumber = m_BootParameters.Profile.LeftFooter.TextStartingNumber
                },
                LeftHeader = new ProductionSetHeaderFooter
                {
                    DatasetFieldSelected = m_BootParameters.Profile.LeftHeader.DatasetFieldSelected,
                    IsIncrementNeededInText = m_BootParameters.Profile.LeftHeader.IsIncrementNeededInText,
                    Option = (HeaderFooterOptions)m_BootParameters.Profile.LeftHeader.Option,
                    TextPrefix = m_BootParameters.Profile.LeftHeader.TextPrefix,
                    TextStartingNumber = m_BootParameters.Profile.LeftHeader.TextStartingNumber
                },
                MiddleFooter = new ProductionSetHeaderFooter
                {
                    DatasetFieldSelected = m_BootParameters.Profile.MiddleFooter.DatasetFieldSelected,
                    IsIncrementNeededInText = m_BootParameters.Profile.MiddleFooter.IsIncrementNeededInText,
                    Option = (HeaderFooterOptions)m_BootParameters.Profile.MiddleFooter.Option,
                    TextPrefix = m_BootParameters.Profile.MiddleFooter.TextPrefix,
                    TextStartingNumber = m_BootParameters.Profile.MiddleFooter.TextStartingNumber

                },
                MiddleHeader = new ProductionSetHeaderFooter
                {
                    DatasetFieldSelected = m_BootParameters.Profile.MiddleHeader.DatasetFieldSelected,
                    IsIncrementNeededInText = m_BootParameters.Profile.MiddleHeader.IsIncrementNeededInText,
                    Option = (HeaderFooterOptions)m_BootParameters.Profile.MiddleHeader.Option,
                    TextPrefix = m_BootParameters.Profile.MiddleHeader.TextPrefix,
                    TextStartingNumber = m_BootParameters.Profile.MiddleHeader.TextStartingNumber

                },
                PrintDCNInPlaceHolderPrefferedText = m_BootParameters.Profile.PrintDCNInPlaceHolderPrefferedText,
                ProductionPrefix = m_BootParameters.Profile.ProductionPrefix,
                ProductionSetNumberingType = (ProductionNumbering)m_BootParameters.Profile.ProductionSetNumberingType,
                ProductionStartingNumber = m_BootParameters.Profile.ProductionStartingNumber,
                ProfileId = m_BootParameters.Profile.ProfileId,
                ProfileName = m_BootParameters.Profile.ProfileName,
                RightFooter = new ProductionSetHeaderFooter
                {
                    DatasetFieldSelected = m_BootParameters.Profile.RightFooter.DatasetFieldSelected,
                    IsIncrementNeededInText = m_BootParameters.Profile.RightFooter.IsIncrementNeededInText,
                    Option = (HeaderFooterOptions)m_BootParameters.Profile.RightFooter.Option,
                    TextPrefix = m_BootParameters.Profile.RightFooter.TextPrefix,
                    TextStartingNumber = m_BootParameters.Profile.RightFooter.TextStartingNumber
                },
                RightHeader = new ProductionSetHeaderFooter
                {
                    DatasetFieldSelected = m_BootParameters.Profile.RightHeader.DatasetFieldSelected,
                    IsIncrementNeededInText = m_BootParameters.Profile.RightHeader.IsIncrementNeededInText,
                    Option = (HeaderFooterOptions)m_BootParameters.Profile.RightHeader.Option,
                    TextPrefix = m_BootParameters.Profile.RightHeader.TextPrefix,
                    TextStartingNumber = m_BootParameters.Profile.RightHeader.TextStartingNumber

                },
                TiffImageColor = (TiffImageColor)m_BootParameters.Profile.TiffImageColor
            };
            return profile;
        }
        /// <summary>
        /// Removes or adds the nodes for the markups based on user selection
        /// </summary>
        /// <param name="xmlString">xml string</param>
        /// <param name="profile">The profile.</param>
        /// <returns></returns>
        private XmlDocument ApplyUserSelections(string xmlString, ProductionProfile profile)
        {
            //using XmlDocument so that underlying XML data can be edited
            var doc = new XmlDocument();
            try
            {
                doc.LoadXml(xmlString);

                XPathNavigator nav = doc.CreateNavigator();

                //All notes need to be removed from markups
                //#defect#87222
                DeleteMarkupNodes(nav, Constants.XpathNotes);

                //Based on user selection markups removed
                if (!profile.IsIncludeArrowsMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathArrow);

                if (!profile.IsIncludeBoxesMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathBoxes);

                if (!profile.IsIncludeHighlightsMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathHighlights);

                if (!profile.IsIncludeLinesMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathLines);

                if (!profile.IsIncludeTextBoxMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathTextBox);

                if (!profile.IsIncludeRubberStampMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathRubberStamp);

                if (!profile.IsIncludeRedactionsMarkup)
                    DeleteMarkupNodes(nav, Constants.XpathRedactions);

                //Execute below code when include available reasons with markups in unchecked
                if (!profile.IsIncludeReasonsWithMarkup)
                {
                    SetAttribute(nav, Constants.XpathComment, Constants.Blank);
                }
            }
            catch (Exception exception)
            {
                Tracer.Info("Production Preprocess Worker:ApplyUserSelections() {0}, Exception details: {1}", xmlString, exception);
            }

            return doc;
        }