잊지 않겠습니다.

  1. Make XmlDocument Instance
  2. CreateXmlDeclaration
  3. Create XmlNode. it is root node
  4. Create another XmlNodes. it is used childNode. these are appended childen to root node

            XmlDocument xmlDocument = new XmlDocument(); -- (1)

            XmlDeclaration xmlDeclation = xmlDocument.CreateXmlDeclaration("1.0", "UTF-8", null); -- (2)
            xmlDocument.InsertBefore(xmlDeclation, xmlDocument.DocumentElement);

            XmlElement rootNode = xmlDocument.CreateElement("SetTeamEXState Message"); --(3)
            xmlDocument.AppendChild(rootNode);

            XmlElement xmlActionNode = xmlDocument.CreateElement("Action");
            XmlAttribute targetAttribute = xmlDocument.CreateAttribute("Target");
            targetAttribute.Value = ouName;
            xmlActionNode.InnerXml = methodName;
            xmlActionNode.Attributes.Append(targetAttribute);
            rootNode.AppendChild(xmlActionNode);

            XmlElement xmlMessageNode = xmlDocument.CreateElement("Message");
            xmlMessageNode.InnerXml = message;
            rootNode.AppendChild(xmlMessageNode);

            return xmlDocument;

Posted by Y2K
,