Create Child Element - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

Create Child Element

Demo Code


using System.Xml;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;// w  w w .jav  a2  s.  c  om

public class Main{
        public static XmlElement CreateChildElement(this XmlElement parent, string elemName)
        {
            XmlElement element = parent.OwnerDocument.CreateElement(elemName);
            parent.AppendChild(element);
            return element;
        }
}

Related Tutorials