title: In an Asp.net MVC view, how do I use jQuery to parse the XML just returned from a controller
body: <p>In my MVC view (using VS 2012 RC), I'm attempting to parse the XML freshly returned from my Controller.
  Here is my view code:</p>
  <pre><code>@model RzMvc.Models.PortfolioResponse
  @{
      ViewBag.Title = &quot;PortfolioList&quot;;
  }              
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  
      $(displayXmlResponse);
  
      function displayXmlResponse(){
          var resp = $(&quot;#xmlResp&quot;);
          $(&quot;#xmlTest&quot;).append(resp.children());
  
          var xml = $(&quot;xmlResp&quot;).text;      
              xmlDoc = $.parseXML(xml),
              $xml = $(xmlDoc),
              $title = $xml.find(&quot;portfolioSummary&quot;);            
  
          $(&quot;#xmlTest&quot;).append($title.text());      
      }    
  
  &lt;/script&gt;
  
  &lt;h2&gt;PortfolioList&lt;/h2&gt;
  
  &lt;div&gt;
      &lt;p id=&quot;xmlTest&quot;&gt;&lt;/p&gt;
      &lt;p id=&quot;xmlResp&quot; &gt;@Model.XmlPortfolioResponse&lt;/p&gt;    
  &lt;/div&gt;
  </code></pre>
  <p>The browser output looks like this:</p>
  <blockquote>
  <p>PortfolioList</p>
  <p>Portfolio Listing</p>
  <p>System.Xml.XmlDocument</p>
  </blockquote>
  <p>Any guidance would be greatly appreciated. Here's part of my Controller code:</p>
  <pre><code>    public ActionResult PortfolioList()
  {
      XmlDocument xmlResponse = new XmlDocument();
      xmlResponse.LoadXml(portfoliosResponse);
      var portf = new PortfolioResponse { XmlPortfolioResponse = xmlResponse };
  
  
      return View(portf);
  }
  </code></pre>
  <p>Model code is:</p>
  <pre><code>namespace RzMvc.Models
  {
  
      public class PortfolioResponse
      {
          public XmlDocument XmlPortfolioResponse { get; set; }
      }
  }
  </code></pre>