xmlを次のように書き出すにはどうすればよいですか
<?xml version="1.0" encoding="UTF-8"?>
<calibration>
  <ZoomLevel 250>0.0100502512562814</ZoomLevel 250>
  <ZoomLevel 250>0.0100502512562814</ZoomLevel 250>
  ........
</calibration>
私はそれを書き出す方法を知っていますが、XMLシートを書くために持っているatmする必要があるループで書き出すことはできません
public void XMLWrite(Dictionary<string, double> dict)
{
    //write the dictonary into an xml file
    XmlDocument doc = new XmlDocument();
    XmlNode docNode = doc.CreateXmlDeclaration("1.0", "UTF-8", null);
    doc.AppendChild(docNode);
    XmlNode productsNode = doc.CreateElement("calibration");
    doc.AppendChild(productsNode);
    foreach (KeyValuePair<string, double> entry in dict)
    {
        XmlNode zoomNode = doc.CreateElement("ZoomLevel");
        XmlAttribute ZoomLevel = doc.CreateAttribute(entry.Key.ToString());
        //XmlElement PixelSize = doc.CreateElement (entry.key = entry.Value.ToString());
        zoomNode.Attributes.Append(ZoomLevel);
        productsNode.AppendChild(zoomNode);
    }
    doc.Save(pathName);
}