public XmlElement getXmlElement(XmlDocument doc, string elemName) { XmlElement elem1; XmlElement elem2; elem1 = doc.CreateElement(elemName); foreach (GPLocationChange chng in changes) { elem2 = doc.CreateElement("Change"); elem1.AppendChild(elem2); chng.writeToXmlNode(elem2, doc); } elem2 = doc.CreateElement("DefaultLocation"); elem2.SetAttribute("type", type.ToString()); elem1.AppendChild(elem2); defaultLocation.writeToXmlNode(elem2, doc); return(elem1); }