title: How to serialize xml into desired format in asp.net web api
body: <p>I am working on asp.net mvc 4 web api. I have a class like,</p>
  
  <pre><code>public class Quiz
  {
  public int QuizId{get; set;}
  public string title{get; set;}
  ...
  ...
  }
  </code></pre>
  
  <p>and now i am trying to retrieve list of quizs so i wrote like,</p>
  
  <pre><code>public List&lt;Quiz&gt; GetQuizs()
  {
  return repository.ListQuizs();
  }
  </code></pre>
  
  <p>i need xml response so i have made configuration in webapi.config file like,</p>
  
  <pre><code>config.Formatters.XmlFormatter.UseXmlSerializer = true;
  </code></pre>
  
  <p>and i got a response like,</p>
  
  <pre><code>&lt;ArrayOfQuiz xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;Quiz&gt;
  &lt;QuizId&gt;4&lt;/QuizId&gt;
  &lt;title&gt;Master Minds&lt;/title&gt;
  &lt;/Quiz&gt;
  &lt;Quiz&gt;
  &lt;QuizId&gt;5&lt;/QuizId&gt;
  &lt;title&gt;Master Minds&lt;/title&gt;
  &lt;/Quiz&gt;
  &lt;/ArrayOfQuiz&gt;
  </code></pre>
  
  <p>but i want the response like </p>
  
  <pre><code>&lt;Quizs&gt;
  &lt;Quiz&gt;
  &lt;QuizId&gt;4&lt;/QuizId&gt;
  &lt;title&gt;Master Minds&lt;/title&gt;
  &lt;/Quiz&gt;
  &lt;Quiz&gt;
  &lt;QuizId&gt;5&lt;/QuizId&gt;
  &lt;title&gt;Master Minds&lt;/title&gt;
  &lt;/Quiz&gt;
  &lt;/Quiz&gt;
  </code></pre>
  
  <p>i have tried like,</p>
  
  <pre><code>public class quizs:List&lt;Quiz&gt;{}
  public class Quiz
  {
  //properties here
  }
  </code></pre>
  
  <p>but i am unable to load list of quizs into quizs class. please guide me.</p>