XML VB.Net

Imports System
Imports System.Xml
Imports System.Xml.XPath
Imports System.Xml.Schema
Public Class MainClass
    Shared errors As Boolean = False
    Private Shared Sub XSDErrors(ByVal o As Object, ByVal e As ValidationEventArgs)
        Console.WriteLine("{0}", e.Message)
        errors = True
    End Sub
    Public Shared Sub Main()
        Dim xsdMarkup As XDocument = _
        
        
            
                
                    
                        
                        
                            
                                
                                    
                                        
                                    
                                

                            

                        
                    

                

            
        
        Dim schemas As XmlSchemaSet = New XmlSchemaSet()
        schemas.Add("", xsdMarkup.CreateReader)
        Dim doc1 As XDocument = 
                                
                                    c1
                                    c2
                                

        Dim doc2 As XDocument = 
                                
                                    content1
                                    content1
                                

        errors = False
        doc1.Validate(schemas, AddressOf XSDErrors, True)
        Console.WriteLine("doc1 {0}", IIf(errors, "did not validate", "validated"))
        errors = False
        doc2.Validate(schemas, AddressOf XSDErrors, True)
        Console.WriteLine("doc2 {0}", IIf(errors, "did not validate", "validated"))
    End Sub
End Class