XML VB.Net

Imports System
Imports System.Xml
Imports System.Xml.Schema
Class XMLSchemaExamples
    Public Shared Sub Main()
        Dim schema As New XmlSchema()
        Dim WaitQueueLengthType As New XmlSchemaSimpleType()
        WaitQueueLengthType.Name = "WaitQueueLengthType"
        Dim restriction As New XmlSchemaSimpleTypeRestriction()
        restriction.BaseTypeName = New XmlQualifiedName("int", "http://www.w3.org/2001/XMLSchema")
        Dim maxExclusive As New XmlSchemaMaxExclusiveFacet()
        maxExclusive.Value = "5"
        restriction.Facets.Add(maxExclusive)
        WaitQueueLengthType.Content = restriction
        schema.Items.Add(WaitQueueLengthType)
        Dim element As New XmlSchemaElement()
        element.Name = "Lobby"
        Dim complexType As New XmlSchemaComplexType()
        Dim WaitQueueLengthAttribute As New XmlSchemaAttribute()
        WaitQueueLengthAttribute.Name = "WaitQueueLength"
        WaitQueueLengthAttribute.SchemaTypeName = New XmlQualifiedName("WaitQueueLengthType", "")
        complexType.Attributes.Add(WaitQueueLengthAttribute)
        element.SchemaType = complexType
        schema.Items.Add(element)
    End Sub
End Class