Hello,

I need assistance generating a xml file by reading values from an array of structs.

my struct looks like this:

Code:
public structure myStruct
dim ID as int
dim myArray1 as boolean
dim myArray2 as boolean
dim myArray3 as boolean
dim x as int
dim y as int
I have several instances of these structs. I also have universal variables that are declared outside of the structs. I am looking to generate a xml file like this:

Code:
<Config>
     <Var1></Var1>
     <Var2></Var2>
     <Struct1>
           <ID></ID>
           <myArray1></myArray1>
           <myArray2></myArray2>
           <myArray3></myArray3>
           <x></x>
     </Struct1>
     <Struct2>
           <ID></ID>
           <myArray1></myArray1>
           <myArray2></myArray2>
           <myArray3></myArray3>
           <x></x>
.
.
.
</Config>
I know I can do something like:

Code:
Dim PrgXml As XElement = _
<Config>
     <Var1></Var1>
     <Var2></Var2>
     <Struct1>
           <ID></ID>
           <myArray1></myArray1>
           <myArray2></myArray2>
           <myArray3></myArray3>
           <x></x>
     </Struct1>
</Config>
But how would I assign the values of each element by reading them in from the struct? Or do I need to use the XmlSerializer Class instead?

Thanks