title: Create file using XmlSerializer: FileStream or XmlWriter?
body: <p>I usually use this kind of code to serialize an object graph to XML:</p>
  
  <pre><code>var ser = new XmlSerializer(myObject.GetType());
  using(var stream = new FileStream(filename, FileMode.Create))
  {
    ser.Serialize(stream , myObject);
  }
  </code></pre>
  
  <p>(Error handling removed for clarity)</p>
  
  <p>What would be the advantage of using an <code>XmlWriter</code> rather than the <code>FileStream</code>?</p>
  
  <p>TIA,</p>