I have an ASP.NET web application that basically consists of a form with many fields that have to be serialized to XML. There is a predetermined structure that the server expects; I have set up my classes (models) to reflect this structure. I have decorated the model classes with the [Serializable] attribute so that the XML structure is preserved. I have tested the serialization; it is working properly. Here is how I tested it:
[HttpPost]
        public XmlResult Sample2(Transmission t)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    XmlResult xrs = new XmlResult(t);
                    xrs.ExecuteResult(ControllerContext);
                    return xrs;
                }
                else
                {
                    return null;
                }
            }
            catch
            {
                return null;
            }
        }
Here is the XmlResult class I'm using:
public class XmlResult : ActionResult
    {
        private object objectToSerialize;
        /// <summary>
        /// Initializes a new instance of the <see cref="XmlResult"/> class.
        /// </summary>
        /// <param name="objectToSerialize">The object to serialize to XML.</param>
        public XmlResult(object objectToSerialize)
        {
            this.objectToSerialize = objectToSerialize;
        }
        /// <summary>
        /// Gets the object to be serialized to XML.
        /// </summary>
        public object ObjectToSerialize
        {
            get { return objectToSerialize; }
        }
        /// <summary>
        /// Serializes the object that was passed into the constructor to XML and writes the corresponding XML to the result stream.
        /// </summary>
        /// <param name="context">The controller context for the current request.</param>
        public override void ExecuteResult(ControllerContext context)
        {
            if (objectToSerialize != null)
            {
                context.HttpContext.Response.Clear();
                var xs = new System.Xml.Serialization.XmlSerializer(objectToSerialize.GetType());
                context.HttpContext.Response.ContentType = "xml";
                xs.Serialize(context.HttpContext.Response.Output, this.objectToSerialize);
            }
        }
    }
Now that I know the data is being serialized in the correct XML format, how can I POST this data to the server using jQuery? Note that I am sending the XML data to a customer's URL via a HTTPPOST request. 
