vb.net: I have a task to take the given xsd file and use that to validate my generated xml file. But now this xsd file has complex type attributes and I cant get to append this complex type to my declared xmlnode.

My Code:

Dim namespaceURI As String = "http://www.blabla.za"
Dim odoc As New XmlDocument
Dim aschema As XmlSchema = XmlSchema.Read(New FileStream(xsdFilePath, FileMode.Open), Nothing)
            odoc.Schemas.Add(aschema)
 Dim oRoot As XmlNode = odoc.CreateNode(XmlNodeType.Element, "RootName", namespaceURI) 
odoc.AppendChild(oRoot)
...
...
' HERES MY PROBLEM
Dim oSubRoot As XmlNode = odoc.CreateNode(XmlNodeType.Element, "SubRootName", namespaceURI)
oRoot.AppendChild(oSubRoot)

This oSubRoot has a Complex Type "Person" ~ I then create this Persons Class but how do I append this class to the oSubRoot node? When I run my code I get this error on my xml file validation
Error: The element 'http://www.blabla.za:SubRootName' is abstract or its type is abstract.

I am still new in xml and would like to know what is the best practice for achieving this task.

This question has already been answered. Start a new discussion instead.