title: How to parse string to xml at asp.net mvc and output it?
body: <p>I`m looking for possibility to parse some input text at xml output.</p>
  
  <p>Such tool <strong>XmlSerializer</strong> did not help me, and I have no idea how to output xml at view. </p>
  
  <p>Thank you for any help.</p>
  
  <p>There is simple model for string input:</p>
  
  <pre><code>[XmlRoot("Text")]
  public class StringModel
  {
      public int InputStringId { get; set; }
      [XmlElement("Sentence")]
      public string InputString { get; set; }
  }
  </code></pre>
  
  <p>Controller, where I have tried with XMLSerialized, but it`s not working</p>
  
  <pre><code>public class StringController : Controller
  {
      public ActionResult Index()
      {
          return View();
      }
      [HttpPost]
      public ActionResult GetString(List&lt;StringModel&gt; line)
      {
          if (ModelState.IsValid)
          {
              XmlSerializer serializer = new XmlSerializer(typeof(List&lt;StringModel&gt;));
              using (StreamWriter sw = new StreamWriter(@"D:StringModel.xml"))
              {
                  serializer.Serialize(sw, line);
              }
          }
          return View();
      }
  </code></pre>