title: xsi:type attribute messing up C# XML deserialization
body: <p>I used XSD.exe to automatically generate C# objects based on the XML schemas (.xsd files). I'm deserializing OpenCover output, but one of the partial classes didn't get generated correctly.</p>
  
  <p>Here's the line that's causing the exception:</p>
  
  <pre><code>&lt;MethodPoint xsi:type="SequencePoint" vc="0" uspid="1" ordinal="0" offset="0" sl="19" sc="9" el="19" ec="10" bec="0" bev="0" fileid="1" /&gt;
  </code></pre>
  
  <p>Here's a shortened version of the MethodPoint class:</p>
  
  <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")]
  [System.SerializableAttribute()]
  [System.Diagnostics.DebuggerStepThroughAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
  public partial class CoverageSessionModulesModuleClassesClassMethodsMethodMethodPoint {
      private string vcField;
      private string uspidField;
      private string ordinalField;
      private string offsetField;
      private string slField;
      private string scField;
      private string elField;
      private string ecField;
      private string becField;
      private string bevField;
      private string fileidField;
  }
  </code></pre>
  
  <p>Now I've been going through a lot of .xml files, but the OpenCover output files are the only ones that contain a colon inside an attribute. The MethodPoint object is also the only object that contains a colon in an attribute. As you can see, the class does not contain the <code>xsi:type</code> attribute, and I know that simply adding it won't work because of the colon. How do you deal with the <code>xsi</code> prefix?</p>
  
  <p>Here is the raw .xsd generated from one of the OpenCover XML files</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema id="CoverageSession" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
    &lt;xs:element name="Summary"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:attribute name="numSequencePoints" type="xs:string" /&gt;
        &lt;xs:attribute name="visitedSequencePoints" type="xs:string" /&gt;
        &lt;xs:attribute name="numBranchPoints" type="xs:string" /&gt;
        &lt;xs:attribute name="visitedBranchPoints" type="xs:string" /&gt;
        &lt;xs:attribute name="sequenceCoverage" type="xs:string" /&gt;
        &lt;xs:attribute name="branchCoverage" type="xs:string" /&gt;
        &lt;xs:attribute name="maxCyclomaticComplexity" type="xs:string" /&gt;
        &lt;xs:attribute name="minCyclomaticComplexity" type="xs:string" /&gt;
        &lt;xs:attribute name="visitedClasses" type="xs:string" /&gt;
        &lt;xs:attribute name="numClasses" type="xs:string" /&gt;
        &lt;xs:attribute name="visitedMethods" type="xs:string" /&gt;
        &lt;xs:attribute name="numMethods" type="xs:string" /&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element name="CoverageSession" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:element ref="Summary" /&gt;
          &lt;xs:element name="Modules"&gt;
            &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                &lt;xs:element name="Module" minOccurs="0" maxOccurs="unbounded"&gt;
                  &lt;xs:complexType&gt;
                    &lt;xs:sequence&gt;
                      &lt;xs:element name="FullName" type="xs:string" minOccurs="0" msdata:Ordinal="1" /&gt;
                      &lt;xs:element name="ModuleName" type="xs:string" minOccurs="0" msdata:Ordinal="2" /&gt;
                      &lt;xs:element ref="Summary" minOccurs="0" maxOccurs="unbounded" /&gt;
                      &lt;xs:element name="Files" minOccurs="0" maxOccurs="unbounded"&gt;
                        &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                            &lt;xs:element name="File" minOccurs="0" maxOccurs="unbounded"&gt;
                              &lt;xs:complexType&gt;
                                &lt;xs:attribute name="uid" type="xs:string" /&gt;
                                &lt;xs:attribute name="fullPath" type="xs:string" /&gt;
                              &lt;/xs:complexType&gt;
                            &lt;/xs:element&gt;
                          &lt;/xs:sequence&gt;
                        &lt;/xs:complexType&gt;
                      &lt;/xs:element&gt;
                      &lt;xs:element name="Classes" minOccurs="0" maxOccurs="unbounded"&gt;
                        &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                            &lt;xs:element name="Class" minOccurs="0" maxOccurs="unbounded"&gt;
                              &lt;xs:complexType&gt;
                                &lt;xs:sequence&gt;
                                  &lt;xs:element name="FullName" type="xs:string" minOccurs="0" /&gt;
                                  &lt;xs:element ref="Summary" minOccurs="0" maxOccurs="unbounded" /&gt;
                                  &lt;xs:element name="Methods" minOccurs="0" maxOccurs="unbounded"&gt;
                                    &lt;xs:complexType&gt;
                                      &lt;xs:sequence&gt;
                                        &lt;xs:element name="Method" minOccurs="0" maxOccurs="unbounded"&gt;
                                          &lt;xs:complexType&gt;
                                            &lt;xs:sequence&gt;
                                              &lt;xs:element name="MetadataToken" type="xs:string" minOccurs="0" msdata:Ordinal="1" /&gt;
                                              &lt;xs:element name="Name" type="xs:string" minOccurs="0" msdata:Ordinal="2" /&gt;
                                              &lt;xs:element ref="Summary" minOccurs="0" maxOccurs="unbounded" /&gt;
                                              &lt;xs:element name="FileRef" minOccurs="0" maxOccurs="unbounded"&gt;
                                                &lt;xs:complexType&gt;
                                                  &lt;xs:attribute name="uid" type="xs:string" /&gt;
                                                &lt;/xs:complexType&gt;
                                              &lt;/xs:element&gt;
                                              &lt;xs:element name="SequencePoints" minOccurs="0" maxOccurs="unbounded"&gt;
                                                &lt;xs:complexType&gt;
                                                  &lt;xs:sequence&gt;
                                                    &lt;xs:element name="SequencePoint" minOccurs="0" maxOccurs="unbounded"&gt;
                                                      &lt;xs:complexType&gt;
                                                        &lt;xs:attribute name="vc" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="uspid" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="ordinal" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="offset" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="sl" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="sc" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="el" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="ec" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="bec" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="bev" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="fileid" type="xs:string" /&gt;
                                                      &lt;/xs:complexType&gt;
                                                    &lt;/xs:element&gt;
                                                  &lt;/xs:sequence&gt;
                                                &lt;/xs:complexType&gt;
                                              &lt;/xs:element&gt;
                                              &lt;xs:element name="BranchPoints" minOccurs="0" maxOccurs="unbounded"&gt;
                                                &lt;xs:complexType&gt;
                                                  &lt;xs:sequence&gt;
                                                    &lt;xs:element name="BranchPoint" minOccurs="0" maxOccurs="unbounded"&gt;
                                                      &lt;xs:complexType&gt;
                                                        &lt;xs:attribute name="vc" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="uspid" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="ordinal" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="offset" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="sl" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="path" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="offsetend" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="fileid" type="xs:string" /&gt;
                                                        &lt;xs:attribute name="offsetchain" type="xs:string" /&gt;
                                                      &lt;/xs:complexType&gt;
                                                    &lt;/xs:element&gt;
                                                  &lt;/xs:sequence&gt;
                                                &lt;/xs:complexType&gt;
                                              &lt;/xs:element&gt;
                                              &lt;xs:element name="MethodPoint" minOccurs="0" maxOccurs="unbounded"&gt;
                                                &lt;xs:complexType&gt;
                                                  &lt;xs:attribute name="vc" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="uspid" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="ordinal" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="offset" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="sl" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="sc" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="el" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="ec" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="bec" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="bev" type="xs:string" /&gt;
                                                  &lt;xs:attribute name="fileid" type="xs:string" /&gt;
                                                &lt;/xs:complexType&gt;
                                              &lt;/xs:element&gt;
                                            &lt;/xs:sequence&gt;
                                            &lt;xs:attribute name="visited" type="xs:string" /&gt;
                                            &lt;xs:attribute name="cyclomaticComplexity" type="xs:string" /&gt;
                                            &lt;xs:attribute name="sequenceCoverage" type="xs:string" /&gt;
                                            &lt;xs:attribute name="branchCoverage" type="xs:string" /&gt;
                                            &lt;xs:attribute name="isConstructor" type="xs:string" /&gt;
                                            &lt;xs:attribute name="isStatic" type="xs:string" /&gt;
                                            &lt;xs:attribute name="isGetter" type="xs:string" /&gt;
                                            &lt;xs:attribute name="isSetter" type="xs:string" /&gt;
                                            &lt;xs:attribute name="skippedDueTo" type="xs:string" /&gt;
                                          &lt;/xs:complexType&gt;
                                        &lt;/xs:element&gt;
                                      &lt;/xs:sequence&gt;
                                    &lt;/xs:complexType&gt;
                                  &lt;/xs:element&gt;
                                &lt;/xs:sequence&gt;
                              &lt;/xs:complexType&gt;
                            &lt;/xs:element&gt;
                          &lt;/xs:sequence&gt;
                        &lt;/xs:complexType&gt;
                      &lt;/xs:element&gt;
                    &lt;/xs:sequence&gt;
                    &lt;xs:attribute name="skippedDueTo" type="xs:string" /&gt;
                    &lt;xs:attribute name="hash" type="xs:string" /&gt;
                  &lt;/xs:complexType&gt;
                &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
        &lt;/xs:choice&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>