title: IXmlSerializable with Interface
body: <p>I'm having a list i'm trying deserialize.
  i not own IBaseIndicator object but it implement IXmlSerializable.</p>
  <p>I just need 2 things to control serialization
  1- overide root elementName
  2-being able set the type as root attribut so i retrieve the type</p>
  <p>for now i have this overide</p>
  <pre><code> public void WriteXml(XmlWriter writer)
          {
              foreach (IBaseIndicator indicator in Indicators)
              {
                  XmlRootAttribute xmlRootAttribute = new XmlRootAttribute();
                  xmlRootAttribute.ElementName = nameof(IBaseIndicator);
  
              //how to insert this kind attribute -&gt;    writer.WriteAttributeString(&quot;AssemblyQualifiedName&quot;, this.GetType().AssemblyQualifiedName);
  
                  XmlSerializer xmlSerializer = new XmlSerializer(indicator.GetType(),xmlRootAttribute);
                  xmlSerializer.Serialize(writer, indicator);
              
              }
          }
  </code></pre>
  <p>this just overide rootname but i like to get this with AssemblyQualifiedName attribute is it even possible ?</p>
  <pre><code>&lt;IBaseIndicator AssemblyQualifiedName=&quot;NosIndicator.Ohlc.Ohlc, NosIndicators, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&quot;&gt;
  </code></pre>