Rolcore.Net.WebMethods.WebMethodsHtmlResponseObject.FindObjectNameNode C# (CSharp) Method

FindObjectNameNode() protected static method

protected static FindObjectNameNode ( string objectName, XmlNode start ) : XmlNode
objectName string
start System.Xml.XmlNode
return System.Xml.XmlNode
        protected static XmlNode FindObjectNameNode(string objectName, XmlNode start)
        {
            if (String.IsNullOrEmpty(objectName))
                throw new ArgumentException("objectName is null or empty.", "objectName");
            if (start == null)
                throw new ArgumentNullException("start", "start is null.");

            string objectNameToLower = objectName.ToLower();
            XmlNode result = null;
            foreach (XmlNode node in start.ChildNodes)
            {
                if (node.InnerXml.Trim().Equals(objectNameToLower, StringComparison.OrdinalIgnoreCase))
                    result = node.ParentNode;
                else
                    result = FindObjectNameNode(objectName, node);
                if (result != null)
                    break;
            }
            return result;
        }