You are on page 1of 1

1.

using System;
using System.Xml.Linq;

namespace ConsoleApp9
{
class Program
{
static void Main(string[] args)
{
XDocument xdoc1 = new XDocument(
new XDeclaration("1","utf-8","yes"),
new XComment("Creating an Xml tree using Linq to XML"),
new XElement("Student",
new XElement("Student",
new XAttribute(),
new XElement(),
new XElement(),
new XElement()

);
xdoc1.Save(\\);

Student[] groupB = new Student[2];


groupB[0] = new Student { };
groupB[1] = new Student { };

XDocument xdoc1 = new XDocument(


new XDeclaration("1", "utf-8", "yes"),
new XComment("Creating an Xml tree using Linq to XML"),
new XElement("Student",
from s in groubB
select new XElement("Student",new XAttribute("id",s.id),
new XElement(),
new XElement(),
new XElement());
xdoc2.Save(\\);
}
}
}

You might also like