public string GetNodeText(object element)
        {
            XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(element);

            if (xmlNode != null)
            {
                return(XmlUtils.GetOwnText(xmlNode));
            }
            object        nodes         = InMetaXmlUtils.InteropSelectNodes(element, "text()");
            StringBuilder stringBuilder = new StringBuilder();
            int           length        = InMetaXmlUtils.InteropGetLength(nodes);

            for (int index = 0; index < length; ++index)
            {
                object node = InMetaXmlUtils.InteropGetItem(nodes, index);
                stringBuilder.Append(InMetaXmlUtils.InteropGetNodeValue(node));
            }
            stringBuilder.Replace("\r\n", "\r");
            stringBuilder.Replace('\n', '\r');
            stringBuilder.Replace("\r", "\r\n");
            return(stringBuilder.ToString());
        }
        public void SetNodeText(object element, string text, bool textAsCDataSection = false)
        {
            XmlNode xmlNode = InMetaXmlUtils.TryGetXmlNode(element);

            if (xmlNode != null)
            {
                XmlUtils.ReplaceOwnText(xmlNode, text);
            }
            else
            {
                object nodes  = InMetaXmlUtils.InteropSelectNodes(element, "text()");
                int    length = InMetaXmlUtils.InteropGetLength(nodes);
                for (int index = 0; index < length; ++index)
                {
                    InMetaXmlUtils.InteropRemoveChild(element, InMetaXmlUtils.InteropGetItem(nodes, index));
                }
                if (string.IsNullOrEmpty(text))
                {
                    return;
                }
                InMetaXmlUtils.InteropAppendChild(element, InMetaXmlUtils.InteropCreateTextNode(InMetaXmlUtils.InteropGetOwnerDocument(element), text));
            }
        }