title: Convert a list of objects to an xml string
body: <p>Hello I have a list of object i want to convert into an xml. Here is what the final xml should look like. </p>
  
  <pre><code>&lt;ArrayOfTweet&gt;
      &lt;Tweet&gt;
          &lt;Photos&gt;
              &lt;Photo&gt;
                  &lt;PhotoHeight&gt;FOO&lt;/PhotoHeight&gt;
                  &lt;PhotoUri&gt;a/random/ur/path&lt;/PhotoUri&gt;
                  &lt;PhotoWidth&gt;923&lt;/PhotoWidth&gt;
                  &lt;SourcePhotoUri&gt;a/random/path&lt;/SourcePhotoUri&gt;
              &lt;/Photo&gt;
          &lt;/Photos&gt;
          &lt;ProfileImage&gt;a/random/path&lt;/ProfileImage&gt;
          &lt;ScreenName&gt;FOO&lt;/ScreenName&gt;
          &lt;Text&gt;some text&lt;/Text&gt;
          &lt;TweetId&gt;1234&lt;/TweetId&gt;
          &lt;UserId&gt;1234&lt;/UserId&gt;
          &lt;Username&gt;BAR&lt;/Username&gt;
      &lt;/Tweet&gt;
      &lt;Tweet&gt;
          &lt;Photos&gt;
              &lt;Photo&gt;
                  &lt;PhotoHeight&gt;FOO&lt;/PhotoHeight&gt;
                  &lt;PhotoUri&gt;a/random/ur/path&lt;/PhotoUri&gt;
                  &lt;PhotoWidth&gt;923&lt;/PhotoWidth&gt;
                  &lt;SourcePhotoUri&gt;a/random/path&lt;/SourcePhotoUri&gt;
              &lt;/Photo&gt;
          &lt;/Photos&gt;
          &lt;ProfileImage&gt;a/random/path&lt;/ProfileImage&gt;
          &lt;ScreenName&gt;FOO&lt;/ScreenName&gt;
          &lt;Text&gt;some text&lt;/Text&gt;
          &lt;TweetId&gt;1234&lt;/TweetId&gt;
          &lt;UserId&gt;1234&lt;/UserId&gt;
          &lt;Username&gt;BAR&lt;/Username&gt;
      &lt;/Tweet&gt;
  &lt;/ArrayOfTweet&gt;
  </code></pre>
  
  <p>I have converted each of the objects in the list into an xml string like so</p>
  
  <pre><code>//TweetList is the list of tweet objects
  
  List&lt;string&gt; xmlStringTweetList = new List&lt;string&gt;();
  foreach (var tl in TweetList)
  {
      xmlStringTweetList.Add(toXML(tl));
  }
  
  private string toXML(Tweet t)
  {
      var stringwriter = new System.IO.StringWriter();
      var serializer = new XmlSerializer(t.GetType());
      serializer.Serialize(stringwriter, t);
      return stringwriter.ToString();
  }
  </code></pre>
  
  <p>I tried converting that list into the format above using </p>
  
  <pre><code>XElement xmlElements = new XElement("ArrayOfTweet", xmlStringTweetList.Select(i =&gt; new XElement("Tweet", i)));
  </code></pre>
  
  <p>But there is the extra <code>&lt;Tweet&gt;&lt;/Tweet&gt;</code>  That i dont need. Is there a way of doing this?</p>