title: Interchange xsd and xsi in the output of XmlSerializer
body: <pre><code>XmlSerializer serializer = new XmlSerializer(typeof(IxComment));
  System.IO.StringWriter aStream = new System.IO.StringWriter();
  serializer.Serialize(aStream,Comments);
  commentsString = aStream.ToString();
  </code></pre>
  
  <p>Here the commentsString has the the following element in it</p>
  
  <pre><code>&lt;IxComment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  </code></pre>
  
  <p>Is there any possibility to interchange the xsi and xsd attribute and get the element as shown below</p>
  
  <pre><code>&lt;IxComment xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" &gt;
  </code></pre>
  
  <p>Will this cause any other issue?</p>
  
  <p><strong>EDIT:</strong> Why do i need  to do this?</p>
  
  <p>We are migrating an existing application from 1.1 to 3.0 and in the code there is a if loop </p>
  
  <pre><code>int iStartTagIndex = strXMLString.IndexOf("&lt;IxComment xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"&gt;");
  </code></pre>
  
  <p>that check for the index of the IxComment. 
  Here the o/p of the serializer and the condition differ in the position of xsd and xsi. So i am trying to know whether we can instruct the serializer to provided the o/p as required. </p>
  
  <p>I have another question here as this was an existing application does the serializer O/P differs with versions?</p>