Hi, you missed creating the
HEDDER
nodes, that's why they're not appearing in the generated XML.
Modify your loop to something like:
for (int i = 10; i < 20; i++)
{
XmlElement hedder = docConfig.CreateElement("HEDDER");
XmlElement installationElement = docConfig.CreateElement("ID");
XmlText installationIdText = docConfig.CreateTextNode(Convert.ToString(i));
installationElement.AppendChild(installationIdText);
hedder.AppendChild(installationElement);
XmlElement environmentElement = docConfig.CreateElement("NAME");
XmlText environText = docConfig.CreateTextNode("ABC" + i);
environmentElement.AppendChild(environText);
hedder.AppendChild(environmentElement);
rootElement.AppendChild(hedder);
}
I hope this helps.