XML-Serialisierung der Liste

Ich serialisiere ein Objekt in XML. Ich habe so etwas:

Class A
{
   public string propertyA1  { get; set; }
   public List<B> bList { get; set; }
}

Class B
{
   public string num {get; set;}
   public string propertyB1  { get; set; }
}

Wenn ich es in XML serialisiere, soll es so aussehen:

<A>
  <propertyA1>someVal</propertyA1> 
  <B num=1>
     <propertyB1>someVal</propertyB1> 
  </B>
  <B num=2>
     <propertyB1>someVal</propertyB1> 
  </B>
</A>

Aber stattdessen sieht es so aus:

<A>
  <propertyA1>someVal</propertyA1> 
  <bList>
     <B num=1>
        <propertyB1>someVal</propertyB1> 
     </B>
     <B num=2>
        <propertyB1>someVal</propertyB1> 
     </B>
  </bList>
</A>

Irgendeine Idee, wie man das los wirdbListe in der Ausgabe? Bei Bedarf kann ich weiteren Beispielcode bereitstellen

Danke, Scott

Antworten auf die Frage(2)

Ihre Antwort auf die Frage