Use the System.Xml and System.Xml.Serialization namespaces. They describe classes that you can use to annotate members of your classes with the appropriate tag.
For example (in C #):
[XmlRoot("foo")]
public class Foo
{
[XmlAttribute("bar")]
public string bar;
[XmlAttribute("baz")]
public double baz;
}
VB.NET( , ):
<XmlRoot ("foo")> _
Public Class Foo
<XmlAttribute ("bar")>_
Public bar As String
<XmlAttribute ("baz")>_
Public baz As String
End Class
XmlSerializer XML.
#:
using(XmlSerializer xmls = new XmlSerializer(typeof(Foo)){
TextWriter tw = new StreamWriter( "foo.xml" );
}
VB:
Using xmls As New XmlSerializer(gettype(Foo)), _
tw As TextWriter = New StreamWriter("foo.xml")
''
End Using
.