I have 3 entities as Goal. Task and Reminder. For each Entity I have separate datatables. Now I want to generate xml like below

```
<PDPData>
  <Goal>
    <TypeId>300</TypeId>
    <NAME>Smart Goal #</NAME>
    <Task>
      <TypeId>11</TypeId>
      <NAME>Task1</NAME>
    </Task>
    <Task>
      <TypeId>12</TypeId>
      <NAME>Task2</NAME>
    </Task>
    <Reminder>
      <TypeId>11</TypeId>
      <NAME>Reminder1</NAME>
    </Reminder>
    <Reminder>
      <TypeId>12</TypeId>
      <NAME>Reminder2</NAME>
    </Reminder>
  </Goal>
</PDPData>

```

How can I acheive this. I tried with below code but its appending only one child but I want to append and within the goal

```
XmlElement hedder = docConfig.CreateElement("Goal");
docConfig.DocumentElement.PrependChild(hedder);
docConfig.ChildNodes.Item(0).AppendChild(hedder);

// Create <installationid> Node
XmlElement installationElement = docConfig.CreateElement("TypeId");
XmlText installationIdText = docConfig.CreateTextNode(dtGoals.Rows[goalCount]["TypeId"].ToString());
installationElement.AppendChild(installationIdText);
hedder.AppendChild(installationElement);

// Create <environment> Node
XmlElement environmentElement = docConfig.CreateElement("NAME");
XmlText environText = docConfig.CreateTextNode(dtGoals.Rows[goalCount]["Name"].ToString());
environmentElement.AppendChild(environText);
hedder.AppendChild(environmentElement);

```