title: Deserializing xml with namespace prefixes that are undefined
body: <p>The Xml response I receive is as follows:</p>
  
  <pre><code>&lt;response&gt;
      &lt;item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:com.someDomain.item"&gt;
          &lt;name&gt;some name&lt;/disc-name&gt;
          &lt;description&gt;some description&lt;/disc-desc&gt;
      &lt;/item&gt;
      &lt;item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="java:com.someDomain.item"&gt;
              &lt;name&gt;some name&lt;/disc-name&gt;
              &lt;description&gt;some description&lt;/disc-desc&gt;
      &lt;/item&gt;
      &lt;otherValue&gt;12.1&lt;/otherValue&gt;
  &lt;/response&gt;
  </code></pre>
  
  <p>My class is decorated as such:</p>
  
  <pre><code>[XmlElement("item")]
  public Item[] Items{get;set;}
  [XmlElement("otherValue")
  public string OtherValue{get;set;}
  </code></pre>
  
  <p>When I attempt to deserialize the above Xml to the class described, I receive an error of "Namespace prefix 'java' is not defined". Adding the "namespace" attribute to the class resolves the parsing error(however, the xml is then distorted from the original).</p>
  
  <p>ie</p>
  
  <pre><code>[XmlElement(ElementName="item",Namespace="java")]
  </code></pre>
  
  <p>How should I be decorating a given property to match up with a new namespace? Or, how do I correctly define the namespace?</p>
  
  <p>I'm not 100% on using a stock array for my enumerable section either, but I think the namespace issue takes precident at the moment. Any insight or thoughts are greatly appreciated!</p>
  
  <p>UPDATE:</p>
  
  <p>I think the question is better rephrased now that I've gone back and forth a bit:</p>
  
  <p>How do you use an XmlElementAttribute(or other attribute) to have a class that can serialize into the item snippet above, including the xsi tags?</p>
  
  <p>As for my particular problem, I've realized since the Xml response is out of my control, I don't need the xsi attributes to begin with. To workaround the serialization issue, I'm simply doing the following(XmlElement element contains the original document above):</p>
  
  <pre><code>foreach(XmlNode node in element)
  node.Attributes.RemoveAll();
  </code></pre>
  
  <p>I'm only noting my personal workaround as this is not actually a solution.</p>