/// <summary>
        /// ?abc?
        /// </summary>
        /// <param name="nodeList">?abc?</param>
        /// <param name="newName">?abc?</param>
        internal static void RenameNode(XmlNodeList nodeList, String newName)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException("nodeList");
            }

            for (Int32 i = nodeList.Count - 1; i >= 0; i--)
            {
                XmlUtility.RenameNode(nodeList[i], newName);
            }
        }
        private static void UpdateNewIdNodes()
        {
            MetadataDocumentManagement metaDataDocMgt = MetadataDocumentManagement.Instance;
            XmlNodeList nodesToBeDeleted = metaDataDocMgt.XmlCurrentFormNode.SelectNodes(@".//a:NewID", metaDataDocMgt.XmlNamespaceMgt);

            for (Int32 i = nodesToBeDeleted.Count - 1; i >= 0; i--)
            {
                XmlUtility.DeleteElements(nodesToBeDeleted[i].ParentNode, ".//a:ID", metaDataDocMgt.XmlNamespaceMgt);
            }

            XmlUtility.RenameNode(nodesToBeDeleted, "ID");
        }
        private void PreRenameNodes()
        {
            XmlNodeList formNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@"./a:Objects/a:Form", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(formNodeList, "Page");

            XmlNodeList subFormIDNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@"./a:Objects/a:Page//a:SubFormID", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(subFormIDNodeList, "PagePartID");

            XmlNodeList timerIntervalNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@"./a:Objects/a:Page/a:Properties/a:TimerInterval", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(timerIntervalNodeList, "TimerUpdate");

            XmlNodeList updateOnActivateNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@"./a:Objects/a:Page/a:Properties/a:UpdateOnActivate", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(updateOnActivateNodeList, "RefreshOnActivate");

            XmlNodeList passwordTextList = metaDataDocMgt.XmlDocument.SelectNodes(@"./a:Objects//a:Control/a:Properties/a:PasswordText", metaDataDocMgt.XmlNamespaceMgt);

            foreach (XmlNode passwordText in passwordTextList)
            {
                XmlNode page   = passwordText.ParentNode.ParentNode.ParentNode.ParentNode; // Node parent to Controls node
                int     pageId = (int)LogEntryObjectId.NotSpecified;

                while (page != null)
                {
                    if (page.Name == "Page")
                    {
                        pageId = Convert.ToInt32(page.Attributes["ID"].Value, CultureInfo.InvariantCulture);
                        page   = null;
                    }
                    else
                    {
                        page = page.ParentNode;
                    }
                }

                TransformationLog.GenericLogEntry(Resources.PasswordText, LogCategory.Warning, pageId, null);

                passwordText.ParentNode.AppendChild(XmlUtility.CreateXmlElement("ExtendedDataType", "Masked"));
                passwordText.ParentNode.RemoveChild(passwordText);
            }
        }
        private void PostProcessControlTypeNode()
        {
            XmlNodeList partNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Control[.//a:Controltype='Part']", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(partNodeList, "Part");

            XmlNodeList fieldNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Control[.//a:Controltype='Field']", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(fieldNodeList, "Field");

            XmlNodeList progressNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Control[.//a:Controltype='ProgressControl']", metaDataDocMgt.XmlNamespaceMgt);

            foreach (XmlNode node in progressNodeList)
            {
                node.FirstChild.AppendChild(XmlUtility.CreateXmlElement("ExtendedDataType", "Ratio"));
            }
            XmlUtility.RenameNode(progressNodeList, "Field");

            XmlNodeList radioNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Control[.//a:Controltype='RadioButton']", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(radioNodeList, "Field");

            // Delete Controltype propety
            XmlUtility.DeleteElements(metaDataDocMgt.XmlDocument, ".//a:Controls//a:Controltype", metaDataDocMgt.XmlNamespaceMgt);

            // Rename OnForm Triggers to OnPage Triggers
            XmlNodeList onFormOpenNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Triggers//a:OnOpenForm", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(onFormOpenNodeList, "OnOpenPage");
            XmlNodeList onFormCloseNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Triggers//a:OnCloseForm", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(onFormCloseNodeList, "OnClosePage");
            XmlNodeList onFormQuCloseNodeList = metaDataDocMgt.XmlDocument.SelectNodes(@".//a:Triggers//a:OnQueryCloseForm", metaDataDocMgt.XmlNamespaceMgt);

            XmlUtility.RenameNode(onFormQuCloseNodeList, "OnQueryClosePage");
        }