Bloom.Edit.WebThumbNailList.MakeGeckoNodeFromXmlNode C# (CSharp) Method

MakeGeckoNodeFromXmlNode() private method

private MakeGeckoNodeFromXmlNode ( Gecko doc, XmlNode xmlElement ) : Gecko.GeckoNode
doc Gecko
xmlElement XmlNode
return Gecko.GeckoNode
        private Gecko.GeckoNode MakeGeckoNodeFromXmlNode(Gecko.GeckoDocument doc, XmlNode xmlElement)
        {
            var result = doc.CreateElement(xmlElement.LocalName);
            foreach (XmlAttribute attr in xmlElement.Attributes)
                result.SetAttribute(attr.LocalName, attr.Value);
            foreach (var child in xmlElement.ChildNodes)
            {
                if (child is XmlElement)
                    result.AppendChild(MakeGeckoNodeFromXmlNode(doc, (XmlElement)child));
                else if (child is XmlText)
                    result.AppendChild(doc.CreateTextNode(((XmlText) child).InnerText));
                else
                {
                    result = result;
                }
            }
            return result;
        }