title: XMLElement - Override Output format
body: <p>what method would i need to override with a custom XmlElement to format the body in a certain order?</p>
  
  <p>Currently, when the class is instantiated, i have it auto-fill the Default Value from the DefaultValueAttribute and create the initial child elements through the constructor.</p>
  
  <p>What i want to do is make sure that the Elements child nodes are in a certain order.  This is not a webservices Xml Transformation but a simple file output for a User Interface.</p>
  
  <p>I tried overriding InnerXml but that was a bust.  If i dont create the initial child elements from the constructor then they never show up.</p>
  
  <h1>Updated</h1>
  
  <h2>Sample Dis-ordered output:</h2>
  
  <pre><code>&lt;ElementType name="RGB"&gt;
    &lt;superType type="Class" /&gt;
    &lt;element name="Alpha" type="int"&gt;
      &lt;default&gt;255&lt;/default&gt;
    &lt;/element&gt;
    &lt;element name="R" type="int"&gt;
      &lt;default&gt;0&lt;/default&gt;
    &lt;/element&gt;
    &lt;element name="G" type="int"&gt;
      &lt;default&gt;0&lt;/default&gt;
    &lt;/element&gt;
    &lt;element name="B" type="int"&gt;
      &lt;default&gt;0&lt;/default&gt;
    &lt;/element&gt;
  &lt;/ElementType&gt;
  </code></pre>
  
  <h2>Sample Ordered output:</h2>
  
  <pre><code>&lt;ElementType name="RGB"&gt;
    &lt;superType type="Class" /&gt;
    &lt;element name="R" type="int"&gt;
        &lt;default&gt;0&lt;/default&gt;
    &lt;/element&gt;
    &lt;element name="G" type="int"&gt;
        &lt;default&gt;0&lt;/default&gt;
    &lt;/element&gt;
    &lt;element name="B" type="int"&gt;
        &lt;default&gt;0&lt;/default&gt;
    &lt;/element&gt;
    &lt;element name="Alpha" type="int"&gt;
      &lt;default&gt;255&lt;/default&gt;
    &lt;/element&gt;
  &lt;/ElementType&gt;
  </code></pre>
  
  <p>Actual output would not be in a XSLT format but this should get the format i am looking for.  Currently, what ever is edited last is at the bottom, and i want to have the various object properties to be outputed in a certain order in the ChildNodes of the parent.  I want to have the iteration overload to a minimum.  I would rather handle the childnode creation be handled on the output of the class into XML format.</p>