SenseNet.ContentRepository.ContentList.FindFieldXmlNode C# (CSharp) Method

FindFieldXmlNode() private method

private FindFieldXmlNode ( string fieldName, XmlDocument &doc ) : XmlNode
fieldName string
doc System.Xml.XmlDocument
return System.Xml.XmlNode
        private XmlNode FindFieldXmlNode(string fieldName, out XmlDocument doc)
        {
            doc = new XmlDocument();
            doc.LoadXml(this.ContentListDefinition);

            if (string.IsNullOrEmpty(fieldName))
                return null;

            var nsmgr = new XmlNamespaceManager(doc.NameTable);
            nsmgr.AddNamespace("x", ContentListDefinitionXmlNamespace);

            var xTemplate = string.Format("/x:ContentListDefinition/x:Fields/x:ContentListField[@name='{0}']", fieldName);

            return string.IsNullOrEmpty(fieldName) ? null : 
                doc.DocumentElement.SelectSingleNode(xTemplate, nsmgr);
        }