title: Xsd2Code and xmldsig
body: <p>I have a problem with generating code from xsd with Xsd2Code. The xsd looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema xmlns:ns1="urn:oasis:names:specification:ubl:schema:xsd:CountryIdentificationCode-1.0"
             xmlns:ns2="urn:oasis:names:specification:ubl:schema:xsd:LocationIdentificationCode-1.0"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
             elementFormDefault="qualified"
             attributeFormDefault="unqualified"&gt;
  
    &lt;xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig.xsd" /&gt;
  
    .......
  
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>The error I fet when I try to serialize the instance of a generated class:</p>
  
  <pre><code>"Cannot serialize object of type 'MyXSD.SignatureValueType'. 
   Consider changing type of XmlText member 'MyXSD.SignatureValueType.Value' from System.Byte[] to string or string array."
  </code></pre>
  
  <p>The error happens here:</p>
  
  <pre><code>[System.Xml.Serialization.XmlTextAttribute(DataType = "base64Binary")]
  public byte[] Value
  {
      get
      {
          return this.valueField;
      }
      set
      {
          this.valueField = value;
      }
  }
  </code></pre>
  
  <p>Event if I change that attribute to:</p>
  
  <pre><code>[System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")]
  </code></pre>
  
  <p>..i get other error:</p>
  
  <pre><code>Type of choice identifier 'ItemsElementName' is inconsistent with type of 'Items'.
  Please use array of System.Collections.Generic.List`1[[MyXSD.ItemsChoiceType2, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].
  </code></pre>
  
  <p>Did anybody successfully use Xsd2Code with xmldsig? If possible I would rather solve this with Xsd2Code generator and not manually. Is there any other option?</p>