title: How to read/write complex object with XmlWriter/XmlReader
body: <p>I've been trying to find an easy way to write XML using the XmlReader/XmlWriter. I don't really like using the interface "IXmlSerializable", but I've got no choice for some of my dataclass.</p>
  
  <p>Anyway, what I want to do is quite simple:</p>
  
  <pre><code>private MyClass myObject;
  public void WriteXml(XmlWriter writer)
  {
      writer.WriteObject(myObject); // &lt;-- this method doesn't exists
  }
  </code></pre>
  
  <p>So, I found 2 work around:</p>
  
  <ol>
  <li>Write my own routine to write my object manually. Quite ridiculous since .Net already does it.</li>
  <li>Create a new serializer using a StringWriter and use the WriteValue(string) method.</li>
  </ol>
  
  <p>I haven't tested the second yet but I think it will probably work (not sure because of the ReadValue result).</p>
  
  <p>Then my question is: Am I missing something important or is it the only way? Or is there a better way to handle that?</p>
  
  <p>Thanks.</p>