Imports System.Xml.Serialization
<XmlRoot("epp", Namespace := "urn:ietf:params:xml:ns:epp-1.0")>
Response = New Response()
<XmlElement(ElementName:="response")> _
Public Property Response As Response
<XmlType(Namespace := "urn:ietf:params:xml:ns:epp-1.0")>
<XmlElement(ElementName:="result")> _
Public Property result As result
<XmlElement(ElementName:="trID")> _
Public Property trID As trID
<XmlType(Namespace := "urn:ietf:params:xml:ns:epp-1.0")>
<XmlElement(ElementName:="svTRID")> _
Public Property svTRID As String
<XmlType(Namespace := "urn:ietf:params:xml:ns:epp-1.0")>
<XmlElement(ElementName:="msg")> _
Public Property msg As String
Public Function GetXml() As String
Dim xml As String = "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""no""?><epp xmlns=""urn:ietf:params:xml:ns:epp-1.0"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd""> <response> <result code=""1000""> <msg>Command completed successfully</msg> </result> <trID> <svTRID>20151019181132-1C16AD22-396-0001</svTRID> </trID> </response></epp>"
Dim x As New XmlSerializer(r.GetType)
Using s As New StringReader(GetXml())
Console.WriteLine("Re-serialized EPP class: ")
Using w As New StringWriter()
Console.WriteLine(w.ToString())