Response to con for XML item, "Difficult to create XML data at the application layer":
Using the ASP.Net C# XmlTextWriter class , I found creating my data in xml format to send to the database fairly simple. XmlTextWriter did all the formatting for me. I could then check the string created and tweak the xmlTextWriter code if need be.
(http://msdn.microsoft.com/en-us/library/system.xml.xmltextwriter.aspx)
I have listed below a sample of the commands I used:
using System.Xml;
using System.IO;
StringWriter writer = new StringWriter();
XmlTextWriter xtWriter = new XmlTextWriter(writer);
xtWriter.WriteStartElement("XML");
xtWriter.WriteStartElement("CutParms");
xtWriter.WriteStartElement("Parm");
//Begin loop
xtWriter.WriteAttributeString("DataYear", ddEventYear.SelectedText);
xtWriter.WriteAttributeString("DataType", ddCertificateType.SelectedValue);
xtWriter.WriteAttributeString("CutType", ddCutTypes.SelectedValue);
xtWriter.WriteAttributeString("RevisedStateList", sJurisdictionList);
//End loop
xtWriter.WriteEndElement();
xtWriter.WriteEndElement();
xtWriter.WriteEndElement();
xtWriter.Close();
sXML = writer.ToString(); // string to send to the database