If your goal is to generate serialized XML, The XmlTextWRiter would allow to create using brute force and it would take care of quotes and angle brackets.
Only the xmldocuement onect can creat new nodes.
To start from scratch, the long way is to call 3 predefined methods of the docuement object, CreateProcessingInstruction to create an XmlProcessingInscrution, then append it to the doc. Then Create an XMLComment using the CreateComment method of the docuement, then append it. The add the first XMLElement using the doc.CreateElement.
If it failed the expception can be used to read the line number, message, and line position.
Comments
Post a Comment