title: What are the differences between the XmlSerializer and BinaryFormatter
body: <p>I spent a good portion of time last week working on serialization. During that time I found many examples utilizing either the BinaryFormatter or XmlSerializer. Unfortunately, what I did not find were any examples comprehensively detailing the differences between the two.</p>
  
  <p>The genesis of my curiosity lies in why the BinaryFormatter is able to deserialize directly to an interface whilst the XmlSerializer is not. <a href="https://stackoverflow.com/users/22656/jon-skeet">Jon Skeet</a> in an answer to "<a href="https://stackoverflow.com/questions/619197/casting-to-multiple-unknown-types-at-runtime/619210#619210">casting to multiple (unknown types) at runtime</a>" provides an example of direct binary serialization to an interface. <a href="https://stackoverflow.com/users/119929/stan-r">Stan R.</a> provided me with the means of accomplishing my goal using the XmlSerializer in his answer to "<a href="https://stackoverflow.com/questions/1145791/xml-object-deserialization-to-interface/1145800#1145800">XML Object Deserialization to Interface</a>."</p>
  
  <p>Beyond the obvious of the BinaryFormatter utilizes binary serialization whilst the XmlSerializer uses XML I'd like to more fully understand the fundamental differences. When to use one or the other and the pros and cons of each.</p>