I'm trying to create and fill an xml file with information. I'm unsure of what to do to make it work. I have a list of items. The list is of type `IEnumerable`. The Items are of my class `MyItem`. `MyItem` has those types in it:

```
public class MyItem
   {
      public Guid MyID { get; set; }
      public String MyString { get; set; }
   }

```

I was able to create an xml file.

```
        DirectoryInfo di = Directory.CreateDirectory(myPath);

        System.Xml.XmlDocument file = new System.Xml.XmlDocument();
        using (FileStream fs = new FileStream(di.FullName + "\\test.xml", FileMode.Create))
        {
            file.Save(fs);
        }

```

But how could I fill `test.xml` with the list of items?

I was imagining to fill my xml file like this:

```
<MyFiles>
   <MyFile>
      <MyID> *Guid here* </MyID>
      <MyString> *String here* </MyString> 
   </MyFile>

   <MyFile>
      <MyID> *Guid2 here* </MyID>
      <MyString> *String2 here* </MyString> 
   </MyFile>
</MyFiles>

```