erminas.SmartAPI.Utils.XmlUtil.AddElement C# (CSharp) Method

AddElement() public static method

Creates an XmlElement and appends it as child to the XmlNode
public static AddElement ( this node, string name ) : XmlElement
node this The parent node
name string Name of the newly created element
return System.Xml.XmlElement
        public static XmlElement AddElement(this XmlNode node, string name)
        {
            var doc = node as XmlDocument;
            doc = doc ?? node.OwnerDocument;
            XmlElement element = doc.CreateElement(name);
            node.AppendChild(element);
            return element;
        }