This Code only works in the Simulator, in the WebSite Version the length of the MemoryStream is 0
System.IO.MemoryStream ms2 = new MemoryStream();
System.IO.StreamWriter writer = new StreamWriter(ms2);
writer.Write(xml);
writer.Flush();
MessageBox.Show(ms2.Length.ToString());