'' ------------------------------------------------------------------------------
''  <auto-generated>
''    Generated by Xsd2Code++. Version 6.0.0.0. www.xsd2code.com
''    {"TargetFramework":"Net48","NameSpace":"ENS_CC315A","Language":"VisualBasic","Properties":{},"XmlAttribute":{"Enabled":true},"ClassParams":{},"Serialization":{"ShouldSerialize":{"IgnoreEmptyNullable":true,"IgnoreEmptyString":true,"IgnoreEmptyCollection":true,"IgnoreEmptyComplexType":true,"IgnoreEmptySimpleType":true,"IgnoreEmptyEnumType":true},"AdditionalSerializers":{},"XmlSerializerEvent":{},"XmlOutput":{"Formating":true,"NewLineOnAttributes":true,"OmitXmlDeclaration":true},"JsonOutput":{},"Enabled":true,"EnableEncoding":true},"Miscellaneous":{},"InitializeFields":"AllExceptOptional"}
''  </auto-generated>
'' ------------------------------------------------------------------------------
#Disable Warning
Imports System
Imports System.Diagnostics
Imports System.Xml.Serialization
Imports System.Runtime.Serialization
Imports System.Collections
Imports System.Xml.Schema
Imports System.ComponentModel
Imports System.Xml
Imports System.IO
Imports System.Text
Imports System.Collections.Generic

Namespace ENS_CC315A

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A"),
     XmlRoot("CC315A", [Namespace]:="http://ics.dgtaxud.ec/CC315A", IsNullable:=False)>
    Partial Public Class CC315AType

#Region "Private fields"
        Private _shouldSerializeMesTypMES20 As Boolean

        Private _mesSenMES3 As String

        Private _mesRecMES6 As String

        Private _datOfPreMES9 As String

        Private _timOfPreMES10 As String

        Private _priMES15 As String

        Private _mesIdeMES19 As String

        Private _mesTypMES20 As MessageTypes

        Private _corIdeMES25 As String

        Private _hEAHEA As HEAHEAType

        Private _tRACONCO1 As TRACONCO1Type

        Private _tRACONCE1 As TRACONCE1Type

        Private _nOTPAR670 As NOTPAR670Type

        Private _gOOITEGDS As List(Of GOOITEGDSType)

        Private _iTI As List(Of ITIType)

        Private _cUSOFFLON As CUSOFFLONType

        Private _tRAREP As TRAREPType

        Private _pERLODSUMDEC As PERLODSUMDECType

        Private _sEAID529 As List(Of SEAID529Type)

        Private _cUSOFFFENT730 As CUSOFFFENT730Type

        Private _cUSOFFSENT740 As List(Of CUSOFFSENT740Type)

        Private _tRACARENT601 As TRACARENT601Type

        Private Shared _serializerXml As XmlSerializer
#End Region

        Public Sub New()
            MyBase.New
            Me._cUSOFFFENT730 = New CUSOFFFENT730Type()
            Me._pERLODSUMDEC = New PERLODSUMDECType()
            Me._gOOITEGDS = New List(Of GOOITEGDSType)()
            Me._hEAHEA = New HEAHEAType()
        End Sub

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property MesSenMES3() As String
            Get
                Return Me._mesSenMES3
            End Get
            Set
                Me._mesSenMES3 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property MesRecMES6() As String
            Get
                Return Me._mesRecMES6
            End Get
            Set
                Me._mesRecMES6 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property DatOfPreMES9() As String
            Get
                Return Me._datOfPreMES9
            End Get
            Set
                Me._datOfPreMES9 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TimOfPreMES10() As String
            Get
                Return Me._timOfPreMES10
            End Get
            Set
                Me._timOfPreMES10 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PriMES15() As String
            Get
                Return Me._priMES15
            End Get
            Set
                Me._priMES15 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property MesIdeMES19() As String
            Get
                Return Me._mesIdeMES19
            End Get
            Set
                Me._mesIdeMES19 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property MesTypMES20() As MessageTypes
            Get
                Return Me._mesTypMES20
            End Get
            Set
                Me._mesTypMES20 = Value
                _shouldSerializeMesTypMES20 = True
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CorIdeMES25() As String
            Get
                Return Me._corIdeMES25
            End Get
            Set
                Me._corIdeMES25 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property HEAHEA() As HEAHEAType
            Get
                Return Me._hEAHEA
            End Get
            Set
                Me._hEAHEA = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TRACONCO1() As TRACONCO1Type
            Get
                Return Me._tRACONCO1
            End Get
            Set
                Me._tRACONCO1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TRACONCE1() As TRACONCE1Type
            Get
                Return Me._tRACONCE1
            End Get
            Set
                Me._tRACONCE1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property NOTPAR670() As NOTPAR670Type
            Get
                Return Me._nOTPAR670
            End Get
            Set
                Me._nOTPAR670 = Value
            End Set
        End Property

        <XmlElement("GOOITEGDS", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property GOOITEGDS() As List(Of GOOITEGDSType)
            Get
                Return Me._gOOITEGDS
            End Get
            Set
                Me._gOOITEGDS = Value
            End Set
        End Property

        <XmlElement("ITI", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property ITI() As List(Of ITIType)
            Get
                Return Me._iTI
            End Get
            Set
                Me._iTI = Value
            End Set
        End Property


        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property CUSOFFLON() As CUSOFFLONType
            Get
                Return Me._cUSOFFLON
            End Get
            Set
                Me._cUSOFFLON = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TRAREP() As TRAREPType
            Get
                Return Me._tRAREP
            End Get
            Set
                Me._tRAREP = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property PERLODSUMDEC() As PERLODSUMDECType
            Get
                Return Me._pERLODSUMDEC
            End Get
            Set
                Me._pERLODSUMDEC = Value
            End Set
        End Property

        <XmlElement("SEAID529", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property SEAID529() As List(Of SEAID529Type)
            Get
                Return Me._sEAID529
            End Get
            Set
                Me._sEAID529 = Value
            End Set
        End Property


        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property CUSOFFFENT730() As CUSOFFFENT730Type
            Get
                Return Me._cUSOFFFENT730
            End Get
            Set
                Me._cUSOFFFENT730 = Value
            End Set
        End Property

        <XmlElement("CUSOFFSENT740", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property CUSOFFSENT740() As List(Of CUSOFFSENT740Type)
            Get
                Return Me._cUSOFFSENT740
            End Get
            Set
                Me._cUSOFFSENT740 = Value
            End Set
        End Property


        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TRACARENT601() As TRACARENT601Type
            Get
                Return Me._tRACARENT601
            End Get
            Set
                Me._tRACARENT601 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CC315AType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether GOOITEGDS should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeGOOITEGDS() As Boolean
            Return GOOITEGDS IsNot Nothing AndAlso GOOITEGDS.Count > 0
        End Function

        ''' <summary>
        ''' Test whether ITI should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeITI() As Boolean
            Return ITI IsNot Nothing AndAlso ITI.Count > 0
        End Function

        ''' <summary>
        ''' Test whether SEAID529 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeSEAID529() As Boolean
            Return SEAID529 IsNot Nothing AndAlso SEAID529.Count > 0
        End Function

        ''' <summary>
        ''' Test whether CUSOFFSENT740 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCUSOFFSENT740() As Boolean
            Return CUSOFFSENT740 IsNot Nothing AndAlso CUSOFFSENT740.Count > 0
        End Function

        ''' <summary>
        ''' Test whether MesTypMES20 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMesTypMES20() As Boolean
            If _shouldSerializeMesTypMES20 Then
                Return True
            End If
            Return (_mesTypMES20 <> CType(Nothing, MessageTypes))
        End Function

        ''' <summary>
        ''' Test whether HEAHEA should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeHEAHEA() As Boolean
            Return (Equals(_hEAHEA, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether TRACONCO1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRACONCO1() As Boolean
            Return (Equals(_tRACONCO1, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether TRACONCE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRACONCE1() As Boolean
            Return (Equals(_tRACONCE1, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether NOTPAR670 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNOTPAR670() As Boolean
            Return (Equals(_nOTPAR670, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether CUSOFFLON should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCUSOFFLON() As Boolean
            Return (Equals(_cUSOFFLON, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether TRAREP should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRAREP() As Boolean
            Return (Equals(_tRAREP, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether PERLODSUMDEC should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePERLODSUMDEC() As Boolean
            Return (Equals(_pERLODSUMDEC, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether CUSOFFFENT730 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCUSOFFFENT730() As Boolean
            Return (Equals(_cUSOFFFENT730, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether TRACARENT601 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRACARENT601() As Boolean
            Return (Equals(_tRACARENT601, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether MesSenMES3 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMesSenMES3() As Boolean
            Return Not String.IsNullOrEmpty(MesSenMES3)
        End Function

        ''' <summary>
        ''' Test whether MesRecMES6 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMesRecMES6() As Boolean
            Return Not String.IsNullOrEmpty(MesRecMES6)
        End Function

        ''' <summary>
        ''' Test whether DatOfPreMES9 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDatOfPreMES9() As Boolean
            Return Not String.IsNullOrEmpty(DatOfPreMES9)
        End Function

        ''' <summary>
        ''' Test whether TimOfPreMES10 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTimOfPreMES10() As Boolean
            Return Not String.IsNullOrEmpty(TimOfPreMES10)
        End Function

        ''' <summary>
        ''' Test whether PriMES15 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePriMES15() As Boolean
            Return Not String.IsNullOrEmpty(PriMES15)
        End Function

        ''' <summary>
        ''' Test whether MesIdeMES19 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMesIdeMES19() As Boolean
            Return Not String.IsNullOrEmpty(MesIdeMES19)
        End Function

        ''' <summary>
        ''' Test whether CorIdeMES25 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCorIdeMES25() As Boolean
            Return Not String.IsNullOrEmpty(CorIdeMES25)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize CC315AType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                ' Optional: Entfernen Sie NewLineOnAttributes, wenn es zu ungewollter Formatierung führt.
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)

                ' Erstelle ein Namespace-Objekt mit dem gewünschten Präfix – es wird nur im Root-Element deklariert.
                Dim ns As New XmlSerializerNamespaces()
                ns.Add("ie", "http://ics.dgtaxud.ec/CC315A")

                ' Übergib das ns-Objekt beim Serialisieren
                SerializerXml.Serialize(xmlWriter, Me, ns)

                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd()
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function


        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes CC315AType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output CC315AType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CC315AType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CC315AType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As CC315AType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CC315AType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As CC315AType
            Return CType(SerializerXml.Deserialize(s), CC315AType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current CC315AType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an CC315AType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output CC315AType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CC315AType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CC315AType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CC315AType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CC315AType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     XmlType([Namespace]:="http://ics.dgtaxud.ec/tcl")>
    Public Enum MessageTypes

        CC304A

        CC305A

        CC313A

        CC315A

        CC316A

        CC323A

        CC324A

        CC325A

        CC328A

        CC351A

        CD030C

        CD031C

        CD032C

        CD070B

        CD071B

        CD301A

        CD302A

        CD303A

        CD319A

        CD411C

        CD412C

        CD906B

        CD912B

        CD913B

        CD914B

        CD916B

        CD917B

        CD931C

        CD932C

        CD971B
    End Enum

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class HEAHEAType

#Region "Private fields"
        Private _shouldSerializeTotGroMasHEA307 As Boolean

        Private _refNumHEA4 As String

        Private _traModAtBorHEA76 As String

        Private _ideOfMeaOfTraCroHEA85 As String

        Private _ideOfMeaOfTraCroHEA85LNG As String

        Private _natOfMeaOfTraCroHEA87 As String

        Private _totNumOfIteHEA305 As String

        Private _totNumOfPacHEA306 As String

        Private _totGroMasHEA307 As Decimal

        Private _decPlaHEA394 As String

        Private _decPlaHEA394LNG As String

        Private _speCirIndHEA1 As String

        Private _traChaMetOfPayHEA1 As String

        Private _comRefNumHEA As String

        Private _conRefNumHEA As String

        Private _plaLoaGOOITE334 As String

        Private _plaLoaGOOITE334LNG As String

        Private _plaUnlGOOITE334 As String

        Private _codPlUnHEA357LNG As String

        Private _decDatTimHEA114 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property RefNumHEA4() As String
            Get
                Return Me._refNumHEA4
            End Get
            Set
                Me._refNumHEA4 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TraModAtBorHEA76() As String
            Get
                Return Me._traModAtBorHEA76
            End Get
            Set
                Me._traModAtBorHEA76 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property IdeOfMeaOfTraCroHEA85() As String
            Get
                Return Me._ideOfMeaOfTraCroHEA85
            End Get
            Set
                Me._ideOfMeaOfTraCroHEA85 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property IdeOfMeaOfTraCroHEA85LNG() As String
            Get
                Return Me._ideOfMeaOfTraCroHEA85LNG
            End Get
            Set
                Me._ideOfMeaOfTraCroHEA85LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NatOfMeaOfTraCroHEA87() As String
            Get
                Return Me._natOfMeaOfTraCroHEA87
            End Get
            Set
                Me._natOfMeaOfTraCroHEA87 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TotNumOfIteHEA305() As String
            Get
                Return Me._totNumOfIteHEA305
            End Get
            Set
                Me._totNumOfIteHEA305 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TotNumOfPacHEA306() As String
            Get
                Return Me._totNumOfPacHEA306
            End Get
            Set
                Me._totNumOfPacHEA306 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TotGroMasHEA307() As Decimal
            Get
                Return Me._totGroMasHEA307
            End Get
            Set
                Me._totGroMasHEA307 = Value
                _shouldSerializeTotGroMasHEA307 = True
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property DecPlaHEA394() As String
            Get
                Return Me._decPlaHEA394
            End Get
            Set
                Me._decPlaHEA394 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property DecPlaHEA394LNG() As String
            Get
                Return Me._decPlaHEA394LNG
            End Get
            Set
                Me._decPlaHEA394LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property SpeCirIndHEA1() As String
            Get
                Return Me._speCirIndHEA1
            End Get
            Set
                Me._speCirIndHEA1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TraChaMetOfPayHEA1() As String
            Get
                Return Me._traChaMetOfPayHEA1
            End Get
            Set
                Me._traChaMetOfPayHEA1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property ComRefNumHEA() As String
            Get
                Return Me._comRefNumHEA
            End Get
            Set
                Me._comRefNumHEA = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property ConRefNumHEA() As String
            Get
                Return Me._conRefNumHEA
            End Get
            Set
                Me._conRefNumHEA = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaLoaGOOITE334() As String
            Get
                Return Me._plaLoaGOOITE334
            End Get
            Set
                Me._plaLoaGOOITE334 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaLoaGOOITE334LNG() As String
            Get
                Return Me._plaLoaGOOITE334LNG
            End Get
            Set
                Me._plaLoaGOOITE334LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaUnlGOOITE334() As String
            Get
                Return Me._plaUnlGOOITE334
            End Get
            Set
                Me._plaUnlGOOITE334 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CodPlUnHEA357LNG() As String
            Get
                Return Me._codPlUnHEA357LNG
            End Get
            Set
                Me._codPlUnHEA357LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property DecDatTimHEA114() As String
            Get
                Return Me._decDatTimHEA114
            End Get
            Set
                Me._decDatTimHEA114 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(HEAHEAType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether TotGroMasHEA307 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTotGroMasHEA307() As Boolean
            Return (Equals(_totGroMasHEA307, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether RefNumHEA4 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeRefNumHEA4() As Boolean
            Return Not String.IsNullOrEmpty(RefNumHEA4)
        End Function

        ''' <summary>
        ''' Test whether TraModAtBorHEA76 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTraModAtBorHEA76() As Boolean
            Return Not String.IsNullOrEmpty(TraModAtBorHEA76)
        End Function

        ''' <summary>
        ''' Test whether IdeOfMeaOfTraCroHEA85 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeIdeOfMeaOfTraCroHEA85() As Boolean
            Return Not String.IsNullOrEmpty(IdeOfMeaOfTraCroHEA85)
        End Function

        ''' <summary>
        ''' Test whether IdeOfMeaOfTraCroHEA85LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeIdeOfMeaOfTraCroHEA85LNG() As Boolean
            Return Not String.IsNullOrEmpty(IdeOfMeaOfTraCroHEA85LNG)
        End Function

        ''' <summary>
        ''' Test whether NatOfMeaOfTraCroHEA87 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNatOfMeaOfTraCroHEA87() As Boolean
            Return Not String.IsNullOrEmpty(NatOfMeaOfTraCroHEA87)
        End Function

        ''' <summary>
        ''' Test whether TotNumOfIteHEA305 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTotNumOfIteHEA305() As Boolean
            Return Not String.IsNullOrEmpty(TotNumOfIteHEA305)
        End Function

        ''' <summary>
        ''' Test whether TotNumOfPacHEA306 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTotNumOfPacHEA306() As Boolean
            Return Not String.IsNullOrEmpty(TotNumOfPacHEA306)
        End Function

        ''' <summary>
        ''' Test whether DecPlaHEA394 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDecPlaHEA394() As Boolean
            Return Not String.IsNullOrEmpty(DecPlaHEA394)
        End Function

        ''' <summary>
        ''' Test whether DecPlaHEA394LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDecPlaHEA394LNG() As Boolean
            Return Not String.IsNullOrEmpty(DecPlaHEA394LNG)
        End Function

        ''' <summary>
        ''' Test whether SpeCirIndHEA1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeSpeCirIndHEA1() As Boolean
            Return Not String.IsNullOrEmpty(SpeCirIndHEA1)
        End Function

        ''' <summary>
        ''' Test whether TraChaMetOfPayHEA1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTraChaMetOfPayHEA1() As Boolean
            Return Not String.IsNullOrEmpty(TraChaMetOfPayHEA1)
        End Function

        ''' <summary>
        ''' Test whether ComRefNumHEA should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeComRefNumHEA() As Boolean
            Return Not String.IsNullOrEmpty(ComRefNumHEA)
        End Function

        ''' <summary>
        ''' Test whether ConRefNumHEA should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeConRefNumHEA() As Boolean
            Return Not String.IsNullOrEmpty(ConRefNumHEA)
        End Function

        ''' <summary>
        ''' Test whether PlaLoaGOOITE334 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaLoaGOOITE334() As Boolean
            Return Not String.IsNullOrEmpty(PlaLoaGOOITE334)
        End Function

        ''' <summary>
        ''' Test whether PlaLoaGOOITE334LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaLoaGOOITE334LNG() As Boolean
            Return Not String.IsNullOrEmpty(PlaLoaGOOITE334LNG)
        End Function

        ''' <summary>
        ''' Test whether PlaUnlGOOITE334 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaUnlGOOITE334() As Boolean
            Return Not String.IsNullOrEmpty(PlaUnlGOOITE334)
        End Function

        ''' <summary>
        ''' Test whether CodPlUnHEA357LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCodPlUnHEA357LNG() As Boolean
            Return Not String.IsNullOrEmpty(CodPlUnHEA357LNG)
        End Function

        ''' <summary>
        ''' Test whether DecDatTimHEA114 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDecDatTimHEA114() As Boolean
            Return Not String.IsNullOrEmpty(DecDatTimHEA114)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize HEAHEAType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes HEAHEAType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output HEAHEAType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, HEAHEAType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As HEAHEAType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As HEAHEAType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), HEAHEAType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As HEAHEAType
            Return CType(SerializerXml.Deserialize(s), HEAHEAType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current HEAHEAType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an HEAHEAType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output HEAHEAType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, HEAHEAType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As HEAHEAType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As HEAHEAType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As HEAHEAType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class TRACARENT601Type

#Region "Private fields"
        Private _namTRACARENT604 As String

        Private _strNumTRACARENT607 As String

        Private _pstCodTRACARENT606 As String

        Private _ctyTRACARENT603 As String

        Private _couCodTRACARENT605 As String

        Private _tRACARENT601LNG As String

        Private _tINTRACARENT602 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamTRACARENT604() As String
            Get
                Return Me._namTRACARENT604
            End Get
            Set
                Me._namTRACARENT604 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrNumTRACARENT607() As String
            Get
                Return Me._strNumTRACARENT607
            End Get
            Set
                Me._strNumTRACARENT607 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PstCodTRACARENT606() As String
            Get
                Return Me._pstCodTRACARENT606
            End Get
            Set
                Me._pstCodTRACARENT606 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CtyTRACARENT603() As String
            Get
                Return Me._ctyTRACARENT603
            End Get
            Set
                Me._ctyTRACARENT603 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCodTRACARENT605() As String
            Get
                Return Me._couCodTRACARENT605
            End Get
            Set
                Me._couCodTRACARENT605 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TRACARENT601LNG() As String
            Get
                Return Me._tRACARENT601LNG
            End Get
            Set
                Me._tRACARENT601LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINTRACARENT602() As String
            Get
                Return Me._tINTRACARENT602
            End Get
            Set
                Me._tINTRACARENT602 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACARENT601Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamTRACARENT604 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamTRACARENT604() As Boolean
            Return Not String.IsNullOrEmpty(NamTRACARENT604)
        End Function

        ''' <summary>
        ''' Test whether StrNumTRACARENT607 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrNumTRACARENT607() As Boolean
            Return Not String.IsNullOrEmpty(StrNumTRACARENT607)
        End Function

        ''' <summary>
        ''' Test whether PstCodTRACARENT606 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePstCodTRACARENT606() As Boolean
            Return Not String.IsNullOrEmpty(PstCodTRACARENT606)
        End Function

        ''' <summary>
        ''' Test whether CtyTRACARENT603 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCtyTRACARENT603() As Boolean
            Return Not String.IsNullOrEmpty(CtyTRACARENT603)
        End Function

        ''' <summary>
        ''' Test whether CouCodTRACARENT605 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCodTRACARENT605() As Boolean
            Return Not String.IsNullOrEmpty(CouCodTRACARENT605)
        End Function

        ''' <summary>
        ''' Test whether TRACARENT601LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRACARENT601LNG() As Boolean
            Return Not String.IsNullOrEmpty(TRACARENT601LNG)
        End Function

        ''' <summary>
        ''' Test whether TINTRACARENT602 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINTRACARENT602() As Boolean
            Return Not String.IsNullOrEmpty(TINTRACARENT602)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize TRACARENT601Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes TRACARENT601Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output TRACARENT601Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACARENT601Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACARENT601Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRACARENT601Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACARENT601Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACARENT601Type
            Return CType(SerializerXml.Deserialize(s), TRACARENT601Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TRACARENT601Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an TRACARENT601Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output TRACARENT601Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACARENT601Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACARENT601Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACARENT601Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACARENT601Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/complex_ics")>
    Partial Public Class CUSOFFSENT740Type

#Region "Private fields"
        Private _refNumSUBENR909 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property RefNumSUBENR909() As String
            Get
                Return Me._refNumSUBENR909
            End Get
            Set
                Me._refNumSUBENR909 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFSENT740Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether RefNumSUBENR909 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeRefNumSUBENR909() As Boolean
            Return Not String.IsNullOrEmpty(RefNumSUBENR909)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize CUSOFFSENT740Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes CUSOFFSENT740Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output CUSOFFSENT740Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CUSOFFSENT740Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFSENT740Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFSENT740Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFSENT740Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFSENT740Type
            Return CType(SerializerXml.Deserialize(s), CUSOFFSENT740Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current CUSOFFSENT740Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an CUSOFFSENT740Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output CUSOFFSENT740Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CUSOFFSENT740Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFSENT740Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFSENT740Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFSENT740Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class CUSOFFFENT730Type

#Region "Private fields"
        Private _refNumCUSOFFFENT731 As String

        Private _expDatOfArrFIRENT733 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property RefNumCUSOFFFENT731() As String
            Get
                Return Me._refNumCUSOFFFENT731
            End Get
            Set
                Me._refNumCUSOFFFENT731 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property ExpDatOfArrFIRENT733() As String
            Get
                Return Me._expDatOfArrFIRENT733
            End Get
            Set
                Me._expDatOfArrFIRENT733 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFFENT730Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether RefNumCUSOFFFENT731 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeRefNumCUSOFFFENT731() As Boolean
            Return Not String.IsNullOrEmpty(RefNumCUSOFFFENT731)
        End Function

        ''' <summary>
        ''' Test whether ExpDatOfArrFIRENT733 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeExpDatOfArrFIRENT733() As Boolean
            Return Not String.IsNullOrEmpty(ExpDatOfArrFIRENT733)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize CUSOFFFENT730Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes CUSOFFFENT730Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output CUSOFFFENT730Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CUSOFFFENT730Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFFENT730Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFFENT730Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFFENT730Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFFENT730Type
            Return CType(SerializerXml.Deserialize(s), CUSOFFFENT730Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current CUSOFFFENT730Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an CUSOFFFENT730Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output CUSOFFFENT730Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CUSOFFFENT730Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFFENT730Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFFENT730Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFFENT730Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/complex_ics")>
    Partial Public Class SEAID529Type

#Region "Private fields"
        Private _seaIdSEAID530 As String

        Private _seaIdSEAID530LNG As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property SeaIdSEAID530() As String
            Get
                Return Me._seaIdSEAID530
            End Get
            Set
                Me._seaIdSEAID530 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property SeaIdSEAID530LNG() As String
            Get
                Return Me._seaIdSEAID530LNG
            End Get
            Set
                Me._seaIdSEAID530LNG = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SEAID529Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether SeaIdSEAID530 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeSeaIdSEAID530() As Boolean
            Return Not String.IsNullOrEmpty(SeaIdSEAID530)
        End Function

        ''' <summary>
        ''' Test whether SeaIdSEAID530LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeSeaIdSEAID530LNG() As Boolean
            Return Not String.IsNullOrEmpty(SeaIdSEAID530LNG)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize SEAID529Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes SEAID529Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output SEAID529Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, SEAID529Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SEAID529Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As SEAID529Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SEAID529Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As SEAID529Type
            Return CType(SerializerXml.Deserialize(s), SEAID529Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current SEAID529Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an SEAID529Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output SEAID529Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, SEAID529Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SEAID529Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SEAID529Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As SEAID529Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class PERLODSUMDECType

#Region "Private fields"
        Private _namPLD1 As String

        Private _strAndNumPLD1 As String

        Private _posCodPLD1 As String

        Private _citPLD1 As String

        Private _couCodPLD1 As String

        Private _pERLODSUMDECLNG As String

        Private _tINPLD1 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamPLD1() As String
            Get
                Return Me._namPLD1
            End Get
            Set
                Me._namPLD1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrAndNumPLD1() As String
            Get
                Return Me._strAndNumPLD1
            End Get
            Set
                Me._strAndNumPLD1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodPLD1() As String
            Get
                Return Me._posCodPLD1
            End Get
            Set
                Me._posCodPLD1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitPLD1() As String
            Get
                Return Me._citPLD1
            End Get
            Set
                Me._citPLD1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCodPLD1() As String
            Get
                Return Me._couCodPLD1
            End Get
            Set
                Me._couCodPLD1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PERLODSUMDECLNG() As String
            Get
                Return Me._pERLODSUMDECLNG
            End Get
            Set
                Me._pERLODSUMDECLNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINPLD1() As String
            Get
                Return Me._tINPLD1
            End Get
            Set
                Me._tINPLD1 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PERLODSUMDECType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamPLD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamPLD1() As Boolean
            Return Not String.IsNullOrEmpty(NamPLD1)
        End Function

        ''' <summary>
        ''' Test whether StrAndNumPLD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrAndNumPLD1() As Boolean
            Return Not String.IsNullOrEmpty(StrAndNumPLD1)
        End Function

        ''' <summary>
        ''' Test whether PosCodPLD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodPLD1() As Boolean
            Return Not String.IsNullOrEmpty(PosCodPLD1)
        End Function

        ''' <summary>
        ''' Test whether CitPLD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitPLD1() As Boolean
            Return Not String.IsNullOrEmpty(CitPLD1)
        End Function

        ''' <summary>
        ''' Test whether CouCodPLD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCodPLD1() As Boolean
            Return Not String.IsNullOrEmpty(CouCodPLD1)
        End Function

        ''' <summary>
        ''' Test whether PERLODSUMDECLNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePERLODSUMDECLNG() As Boolean
            Return Not String.IsNullOrEmpty(PERLODSUMDECLNG)
        End Function

        ''' <summary>
        ''' Test whether TINPLD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINPLD1() As Boolean
            Return Not String.IsNullOrEmpty(TINPLD1)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize PERLODSUMDECType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes PERLODSUMDECType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output PERLODSUMDECType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PERLODSUMDECType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PERLODSUMDECType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As PERLODSUMDECType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PERLODSUMDECType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As PERLODSUMDECType
            Return CType(SerializerXml.Deserialize(s), PERLODSUMDECType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current PERLODSUMDECType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an PERLODSUMDECType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output PERLODSUMDECType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PERLODSUMDECType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PERLODSUMDECType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PERLODSUMDECType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PERLODSUMDECType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class TRAREPType

#Region "Private fields"
        Private _namTRE1 As String

        Private _strAndNumTRE1 As String

        Private _posCodTRE1 As String

        Private _citTRE1 As String

        Private _couCodTRE1 As String

        Private _tRAREPLNG As String

        Private _tINTRE1 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamTRE1() As String
            Get
                Return Me._namTRE1
            End Get
            Set
                Me._namTRE1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrAndNumTRE1() As String
            Get
                Return Me._strAndNumTRE1
            End Get
            Set
                Me._strAndNumTRE1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodTRE1() As String
            Get
                Return Me._posCodTRE1
            End Get
            Set
                Me._posCodTRE1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitTRE1() As String
            Get
                Return Me._citTRE1
            End Get
            Set
                Me._citTRE1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCodTRE1() As String
            Get
                Return Me._couCodTRE1
            End Get
            Set
                Me._couCodTRE1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property TRAREPLNG() As String
            Get
                Return Me._tRAREPLNG
            End Get
            Set
                Me._tRAREPLNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINTRE1() As String
            Get
                Return Me._tINTRE1
            End Get
            Set
                Me._tINTRE1 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRAREPType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamTRE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamTRE1() As Boolean
            Return Not String.IsNullOrEmpty(NamTRE1)
        End Function

        ''' <summary>
        ''' Test whether StrAndNumTRE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrAndNumTRE1() As Boolean
            Return Not String.IsNullOrEmpty(StrAndNumTRE1)
        End Function

        ''' <summary>
        ''' Test whether PosCodTRE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodTRE1() As Boolean
            Return Not String.IsNullOrEmpty(PosCodTRE1)
        End Function

        ''' <summary>
        ''' Test whether CitTRE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitTRE1() As Boolean
            Return Not String.IsNullOrEmpty(CitTRE1)
        End Function

        ''' <summary>
        ''' Test whether CouCodTRE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCodTRE1() As Boolean
            Return Not String.IsNullOrEmpty(CouCodTRE1)
        End Function

        ''' <summary>
        ''' Test whether TRAREPLNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRAREPLNG() As Boolean
            Return Not String.IsNullOrEmpty(TRAREPLNG)
        End Function

        ''' <summary>
        ''' Test whether TINTRE1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINTRE1() As Boolean
            Return Not String.IsNullOrEmpty(TINTRE1)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize TRAREPType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes TRAREPType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output TRAREPType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRAREPType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRAREPType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRAREPType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRAREPType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRAREPType
            Return CType(SerializerXml.Deserialize(s), TRAREPType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TRAREPType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an TRAREPType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output TRAREPType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRAREPType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRAREPType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRAREPType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRAREPType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class CUSOFFLONType

#Region "Private fields"
        Private _refNumCOL1 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property RefNumCOL1() As String
            Get
                Return Me._refNumCOL1
            End Get
            Set
                Me._refNumCOL1 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CUSOFFLONType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether RefNumCOL1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeRefNumCOL1() As Boolean
            Return Not String.IsNullOrEmpty(RefNumCOL1)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize CUSOFFLONType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes CUSOFFLONType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output CUSOFFLONType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CUSOFFLONType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CUSOFFLONType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As CUSOFFLONType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CUSOFFLONType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As CUSOFFLONType
            Return CType(SerializerXml.Deserialize(s), CUSOFFLONType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current CUSOFFLONType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an CUSOFFLONType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output CUSOFFLONType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CUSOFFLONType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CUSOFFLONType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CUSOFFLONType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CUSOFFLONType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/complex_ics")>
    Partial Public Class ITIType

#Region "Private fields"
        Private _couOfRouCodITI1 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouOfRouCodITI1() As String
            Get
                Return Me._couOfRouCodITI1
            End Get
            Set
                Me._couOfRouCodITI1 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(ITIType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether CouOfRouCodITI1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouOfRouCodITI1() As Boolean
            Return Not String.IsNullOrEmpty(CouOfRouCodITI1)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize ITIType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes ITIType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output ITIType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, ITIType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As ITIType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As ITIType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), ITIType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As ITIType
            Return CType(SerializerXml.Deserialize(s), ITIType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current ITIType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an ITIType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output ITIType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, ITIType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As ITIType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As ITIType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As ITIType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class PRTNOT640Type

#Region "Private fields"
        Private _namPRTNOT642 As String

        Private _strNumPRTNOT646 As String

        Private _pstCodPRTNOT644 As String

        Private _ctyPRTNOT643 As String

        Private _couCodGINOT647 As String

        Private _pRTNOT640LNG As String

        Private _tINPRTNOT641 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamPRTNOT642() As String
            Get
                Return Me._namPRTNOT642
            End Get
            Set
                Me._namPRTNOT642 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrNumPRTNOT646() As String
            Get
                Return Me._strNumPRTNOT646
            End Get
            Set
                Me._strNumPRTNOT646 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PstCodPRTNOT644() As String
            Get
                Return Me._pstCodPRTNOT644
            End Get
            Set
                Me._pstCodPRTNOT644 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CtyPRTNOT643() As String
            Get
                Return Me._ctyPRTNOT643
            End Get
            Set
                Me._ctyPRTNOT643 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCodGINOT647() As String
            Get
                Return Me._couCodGINOT647
            End Get
            Set
                Me._couCodGINOT647 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PRTNOT640LNG() As String
            Get
                Return Me._pRTNOT640LNG
            End Get
            Set
                Me._pRTNOT640LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINPRTNOT641() As String
            Get
                Return Me._tINPRTNOT641
            End Get
            Set
                Me._tINPRTNOT641 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRTNOT640Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamPRTNOT642 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamPRTNOT642() As Boolean
            Return Not String.IsNullOrEmpty(NamPRTNOT642)
        End Function

        ''' <summary>
        ''' Test whether StrNumPRTNOT646 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrNumPRTNOT646() As Boolean
            Return Not String.IsNullOrEmpty(StrNumPRTNOT646)
        End Function

        ''' <summary>
        ''' Test whether PstCodPRTNOT644 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePstCodPRTNOT644() As Boolean
            Return Not String.IsNullOrEmpty(PstCodPRTNOT644)
        End Function

        ''' <summary>
        ''' Test whether CtyPRTNOT643 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCtyPRTNOT643() As Boolean
            Return Not String.IsNullOrEmpty(CtyPRTNOT643)
        End Function

        ''' <summary>
        ''' Test whether CouCodGINOT647 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCodGINOT647() As Boolean
            Return Not String.IsNullOrEmpty(CouCodGINOT647)
        End Function

        ''' <summary>
        ''' Test whether PRTNOT640LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePRTNOT640LNG() As Boolean
            Return Not String.IsNullOrEmpty(PRTNOT640LNG)
        End Function

        ''' <summary>
        ''' Test whether TINPRTNOT641 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINPRTNOT641() As Boolean
            Return Not String.IsNullOrEmpty(TINPRTNOT641)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize PRTNOT640Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes PRTNOT640Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output PRTNOT640Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PRTNOT640Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRTNOT640Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As PRTNOT640Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRTNOT640Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRTNOT640Type
            Return CType(SerializerXml.Deserialize(s), PRTNOT640Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current PRTNOT640Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an PRTNOT640Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output PRTNOT640Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PRTNOT640Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRTNOT640Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRTNOT640Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PRTNOT640Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code")>
    Partial Public Class PACGS2Type

#Region "Private fields"
        Private _kinOfPacGS23 As String
        Private _numOfPacGS24 As String
        Private _numOfPieGS25 As String
        Private _marNumOfPacGSL21 As String
        Private _marNumOfPacGSL21LNG As String
        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=1)>
        Public Property KinOfPacGS23() As String
            Get
                Return Me._kinOfPacGS23
            End Get
            Set(ByVal value As String)
                Me._kinOfPacGS23 = value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=2)>
        Public Property NumOfPacGS24() As String
            Get
                Return Me._numOfPacGS24
            End Get
            Set(ByVal value As String)
                Me._numOfPacGS24 = value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=3)>
        Public Property NumOfPieGS25() As String
            Get
                Return Me._numOfPieGS25
            End Get
            Set(ByVal value As String)
                Me._numOfPieGS25 = value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=4)>
        Public Property MarNumOfPacGSL21() As String
            Get
                Return Me._marNumOfPacGSL21
            End Get
            Set(ByVal value As String)
                Me._marNumOfPacGSL21 = value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=5)>
        Public Property MarNumOfPacGSL21LNG() As String
            Get
                Return Me._marNumOfPacGSL21LNG
            End Get
            Set(ByVal value As String)
                Me._marNumOfPacGSL21LNG = value
            End Set
        End Property


        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PACGS2Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether KinOfPacGS23 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeKinOfPacGS23() As Boolean
            Return Not String.IsNullOrEmpty(KinOfPacGS23)
        End Function

        ''' <summary>
        ''' Test whether NumOfPacGS24 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNumOfPacGS24() As Boolean
            Return Not String.IsNullOrEmpty(NumOfPacGS24)
        End Function

        ''' <summary>
        ''' Test whether NumOfPieGS25 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNumOfPieGS25() As Boolean
            Return Not String.IsNullOrEmpty(NumOfPieGS25)
        End Function

        ''' <summary>
        ''' Test whether MarNumOfPacGSL21 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMarNumOfPacGSL21() As Boolean
            Return Not String.IsNullOrEmpty(MarNumOfPacGSL21)
        End Function

        ''' <summary>
        ''' Test whether MarNumOfPacGSL21LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMarNumOfPacGSL21LNG() As Boolean
            Return Not String.IsNullOrEmpty(MarNumOfPacGSL21LNG)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize PACGS2Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes PACGS2Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output PACGS2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PACGS2Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PACGS2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As PACGS2Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PACGS2Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As PACGS2Type
            Return CType(SerializerXml.Deserialize(s), PACGS2Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current PACGS2Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an PACGS2Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output PACGS2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PACGS2Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PACGS2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PACGS2Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PACGS2Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class IDEMEATRAGI970Type

#Region "Private fields"
        Private _natIDEMEATRAGI973 As String

        Private _ideMeaTraGIMEATRA971 As String

        Private _ideMeaTraGIMEATRA972LNG As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NatIDEMEATRAGI973() As String
            Get
                Return Me._natIDEMEATRAGI973
            End Get
            Set
                Me._natIDEMEATRAGI973 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property IdeMeaTraGIMEATRA971() As String
            Get
                Return Me._ideMeaTraGIMEATRA971
            End Get
            Set
                Me._ideMeaTraGIMEATRA971 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property IdeMeaTraGIMEATRA972LNG() As String
            Get
                Return Me._ideMeaTraGIMEATRA972LNG
            End Get
            Set
                Me._ideMeaTraGIMEATRA972LNG = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(IDEMEATRAGI970Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NatIDEMEATRAGI973 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNatIDEMEATRAGI973() As Boolean
            Return Not String.IsNullOrEmpty(NatIDEMEATRAGI973)
        End Function

        ''' <summary>
        ''' Test whether IdeMeaTraGIMEATRA971 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeIdeMeaTraGIMEATRA971() As Boolean
            Return Not String.IsNullOrEmpty(IdeMeaTraGIMEATRA971)
        End Function

        ''' <summary>
        ''' Test whether IdeMeaTraGIMEATRA972LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeIdeMeaTraGIMEATRA972LNG() As Boolean
            Return Not String.IsNullOrEmpty(IdeMeaTraGIMEATRA972LNG)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize IDEMEATRAGI970Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes IDEMEATRAGI970Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output IDEMEATRAGI970Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, IDEMEATRAGI970Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As IDEMEATRAGI970Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As IDEMEATRAGI970Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), IDEMEATRAGI970Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As IDEMEATRAGI970Type
            Return CType(SerializerXml.Deserialize(s), IDEMEATRAGI970Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current IDEMEATRAGI970Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an IDEMEATRAGI970Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output IDEMEATRAGI970Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, IDEMEATRAGI970Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As IDEMEATRAGI970Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As IDEMEATRAGI970Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As IDEMEATRAGI970Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class CONNR2Type

#Region "Private fields"
        Private _conNumNR21 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property ConNumNR21() As String
            Get
                Return Me._conNumNR21
            End Get
            Set
                Me._conNumNR21 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(CONNR2Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether ConNumNR21 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeConNumNR21() As Boolean
            Return Not String.IsNullOrEmpty(ConNumNR21)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize CONNR2Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes CONNR2Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output CONNR2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CONNR2Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As CONNR2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As CONNR2Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), CONNR2Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As CONNR2Type
            Return CType(SerializerXml.Deserialize(s), CONNR2Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current CONNR2Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an CONNR2Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output CONNR2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, CONNR2Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As CONNR2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As CONNR2Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As CONNR2Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class TRACONCE2Type

#Region "Private fields"
        Private _namCE27 As String

        Private _strAndNumCE222 As String

        Private _posCodCE223 As String

        Private _citCE224 As String

        Private _couCE225 As String

        Private _nADLNGGICE As String

        Private _tINCE259 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamCE27() As String
            Get
                Return Me._namCE27
            End Get
            Set
                Me._namCE27 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrAndNumCE222() As String
            Get
                Return Me._strAndNumCE222
            End Get
            Set
                Me._strAndNumCE222 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodCE223() As String
            Get
                Return Me._posCodCE223
            End Get
            Set
                Me._posCodCE223 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitCE224() As String
            Get
                Return Me._citCE224
            End Get
            Set
                Me._citCE224 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCE225() As String
            Get
                Return Me._couCE225
            End Get
            Set
                Me._couCE225 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NADLNGGICE() As String
            Get
                Return Me._nADLNGGICE
            End Get
            Set
                Me._nADLNGGICE = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINCE259() As String
            Get
                Return Me._tINCE259
            End Get
            Set
                Me._tINCE259 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCE2Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamCE27 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamCE27() As Boolean
            Return Not String.IsNullOrEmpty(NamCE27)
        End Function

        ''' <summary>
        ''' Test whether StrAndNumCE222 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrAndNumCE222() As Boolean
            Return Not String.IsNullOrEmpty(StrAndNumCE222)
        End Function

        ''' <summary>
        ''' Test whether PosCodCE223 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodCE223() As Boolean
            Return Not String.IsNullOrEmpty(PosCodCE223)
        End Function

        ''' <summary>
        ''' Test whether CitCE224 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitCE224() As Boolean
            Return Not String.IsNullOrEmpty(CitCE224)
        End Function

        ''' <summary>
        ''' Test whether CouCE225 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCE225() As Boolean
            Return Not String.IsNullOrEmpty(CouCE225)
        End Function

        ''' <summary>
        ''' Test whether NADLNGGICE should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNADLNGGICE() As Boolean
            Return Not String.IsNullOrEmpty(NADLNGGICE)
        End Function

        ''' <summary>
        ''' Test whether TINCE259 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINCE259() As Boolean
            Return Not String.IsNullOrEmpty(TINCE259)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize TRACONCE2Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes TRACONCE2Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output TRACONCE2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCE2Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCE2Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCE2Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCE2Type
            Return CType(SerializerXml.Deserialize(s), TRACONCE2Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TRACONCE2Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an TRACONCE2Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output TRACONCE2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCE2Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCE2Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCE2Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/complex_ics")>
    Partial Public Class COMCODGODITMType

#Region "Private fields"
        Private _comNomCMD1 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property ComNomCMD1() As String
            Get
                Return Me._comNomCMD1
            End Get
            Set
                Me._comNomCMD1 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(COMCODGODITMType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether ComNomCMD1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeComNomCMD1() As Boolean
            Return Not String.IsNullOrEmpty(ComNomCMD1)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize COMCODGODITMType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes COMCODGODITMType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output COMCODGODITMType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, COMCODGODITMType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As COMCODGODITMType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As COMCODGODITMType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), COMCODGODITMType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As COMCODGODITMType
            Return CType(SerializerXml.Deserialize(s), COMCODGODITMType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current COMCODGODITMType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an COMCODGODITMType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output COMCODGODITMType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, COMCODGODITMType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As COMCODGODITMType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As COMCODGODITMType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As COMCODGODITMType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class TRACONCO2Type

#Region "Private fields"
        Private _namCO27 As String

        Private _strAndNumCO222 As String

        Private _posCodCO223 As String

        Private _citCO224 As String

        Private _couCO225 As String

        Private _nADLNGGTCO As String

        Private _tINCO259 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamCO27() As String
            Get
                Return Me._namCO27
            End Get
            Set
                Me._namCO27 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrAndNumCO222() As String
            Get
                Return Me._strAndNumCO222
            End Get
            Set
                Me._strAndNumCO222 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodCO223() As String
            Get
                Return Me._posCodCO223
            End Get
            Set
                Me._posCodCO223 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitCO224() As String
            Get
                Return Me._citCO224
            End Get
            Set
                Me._citCO224 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCO225() As String
            Get
                Return Me._couCO225
            End Get
            Set
                Me._couCO225 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NADLNGGTCO() As String
            Get
                Return Me._nADLNGGTCO
            End Get
            Set
                Me._nADLNGGTCO = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINCO259() As String
            Get
                Return Me._tINCO259
            End Get
            Set
                Me._tINCO259 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCO2Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamCO27 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamCO27() As Boolean
            Return Not String.IsNullOrEmpty(NamCO27)
        End Function

        ''' <summary>
        ''' Test whether StrAndNumCO222 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrAndNumCO222() As Boolean
            Return Not String.IsNullOrEmpty(StrAndNumCO222)
        End Function

        ''' <summary>
        ''' Test whether PosCodCO223 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodCO223() As Boolean
            Return Not String.IsNullOrEmpty(PosCodCO223)
        End Function

        ''' <summary>
        ''' Test whether CitCO224 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitCO224() As Boolean
            Return Not String.IsNullOrEmpty(CitCO224)
        End Function

        ''' <summary>
        ''' Test whether CouCO225 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCO225() As Boolean
            Return Not String.IsNullOrEmpty(CouCO225)
        End Function

        ''' <summary>
        ''' Test whether NADLNGGTCO should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNADLNGGTCO() As Boolean
            Return Not String.IsNullOrEmpty(NADLNGGTCO)
        End Function

        ''' <summary>
        ''' Test whether TINCO259 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINCO259() As Boolean
            Return Not String.IsNullOrEmpty(TINCO259)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize TRACONCO2Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes TRACONCO2Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output TRACONCO2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCO2Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCO2Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCO2Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCO2Type
            Return CType(SerializerXml.Deserialize(s), TRACONCO2Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TRACONCO2Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an TRACONCO2Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output TRACONCO2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCO2Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCO2Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCO2Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/complex_ics")>
    Partial Public Class SPEMENMT2Type

#Region "Private fields"
        Private _addInfCodMT23 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property AddInfCodMT23() As String
            Get
                Return Me._addInfCodMT23
            End Get
            Set
                Me._addInfCodMT23 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(SPEMENMT2Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether AddInfCodMT23 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeAddInfCodMT23() As Boolean
            Return Not String.IsNullOrEmpty(AddInfCodMT23)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize SPEMENMT2Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes SPEMENMT2Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output SPEMENMT2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, SPEMENMT2Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As SPEMENMT2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As SPEMENMT2Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), SPEMENMT2Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As SPEMENMT2Type
            Return CType(SerializerXml.Deserialize(s), SPEMENMT2Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current SPEMENMT2Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an SPEMENMT2Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output SPEMENMT2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, SPEMENMT2Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As SPEMENMT2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As SPEMENMT2Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As SPEMENMT2Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class PRODOCDC2Type

#Region "Private fields"
        Private _docTypDC21 As String
        Private _docRefDC23 As String
        Private _docRefDCLNG As String
        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=1)>
        Public Property DocTypDC21() As String
            Get
                Return Me._docTypDC21
            End Get
            Set(ByVal Value As String)
                Me._docTypDC21 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=2)>
        Public Property DocRefDC23() As String
            Get
                Return Me._docRefDC23
            End Get
            Set(ByVal Value As String)
                Me._docRefDC23 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token", Order:=3)>
        Public Property DocRefDCLNG() As String
            Get
                Return Me._docRefDCLNG
            End Get
            Set(ByVal Value As String)
                Me._docRefDCLNG = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(PRODOCDC2Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether DocTypDC21 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDocTypDC21() As Boolean
            Return Not String.IsNullOrEmpty(DocTypDC21)
        End Function

        ''' <summary>
        ''' Test whether DocRefDC23 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDocRefDC23() As Boolean
            Return Not String.IsNullOrEmpty(DocRefDC23)
        End Function

        ''' <summary>
        ''' Test whether DocRefDCLNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeDocRefDCLNG() As Boolean
            Return Not String.IsNullOrEmpty(DocRefDCLNG)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize PRODOCDC2Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes PRODOCDC2Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output PRODOCDC2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PRODOCDC2Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As PRODOCDC2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As PRODOCDC2Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), PRODOCDC2Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As PRODOCDC2Type
            Return CType(SerializerXml.Deserialize(s), PRODOCDC2Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current PRODOCDC2Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an PRODOCDC2Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output PRODOCDC2Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, PRODOCDC2Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As PRODOCDC2Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As PRODOCDC2Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As PRODOCDC2Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class GOOITEGDSType

#Region "Private fields"
        Private _shouldSerializeGroMasGDS46 As Boolean

        Private _iteNumGDS7 As String

        Private _gooDesGDS23 As String

        Private _gooDesGDS23LNG As String

        Private _groMasGDS46 As Decimal

        Private _metOfPayGDI12 As String

        Private _comRefNumGIM1 As String

        Private _uNDanGooCodGDI1 As String

        Private _plaLoaGOOITE333 As String

        Private _plaLoaGOOITE333LNG As String

        Private _plaUnlGOOITE333 As String

        Private _plaUnlGOOITE333LNG As String

        Private _pRODOCDC2 As List(Of PRODOCDC2Type)

        Private _sPEMENMT2 As List(Of SPEMENMT2Type)

        Private _tRACONCO2 As TRACONCO2Type

        Private _cOMCODGODITM As COMCODGODITMType

        Private _tRACONCE2 As TRACONCE2Type

        Private _cONNR2 As List(Of CONNR2Type)

        Private _iDEMEATRAGI970 As List(Of IDEMEATRAGI970Type)

        Private _pACGS2 As List(Of PACGS2Type)

        Private _pRTNOT640 As PRTNOT640Type

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property IteNumGDS7() As String
            Get
                Return Me._iteNumGDS7
            End Get
            Set
                Me._iteNumGDS7 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property GooDesGDS23() As String
            Get
                Return Me._gooDesGDS23
            End Get
            Set
                Me._gooDesGDS23 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property GooDesGDS23LNG() As String
            Get
                Return Me._gooDesGDS23LNG
            End Get
            Set
                Me._gooDesGDS23LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property GroMasGDS46() As Decimal
            Get
                Return Me._groMasGDS46
            End Get
            Set
                Me._groMasGDS46 = Value
                _shouldSerializeGroMasGDS46 = True
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property MetOfPayGDI12() As String
            Get
                Return Me._metOfPayGDI12
            End Get
            Set
                Me._metOfPayGDI12 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property ComRefNumGIM1() As String
            Get
                Return Me._comRefNumGIM1
            End Get
            Set
                Me._comRefNumGIM1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property UNDanGooCodGDI1() As String
            Get
                Return Me._uNDanGooCodGDI1
            End Get
            Set
                Me._uNDanGooCodGDI1 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaLoaGOOITE333() As String
            Get
                Return Me._plaLoaGOOITE333
            End Get
            Set
                Me._plaLoaGOOITE333 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaLoaGOOITE333LNG() As String
            Get
                Return Me._plaLoaGOOITE333LNG
            End Get
            Set
                Me._plaLoaGOOITE333LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaUnlGOOITE333() As String
            Get
                Return Me._plaUnlGOOITE333
            End Get
            Set
                Me._plaUnlGOOITE333 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PlaUnlGOOITE333LNG() As String
            Get
                Return Me._plaUnlGOOITE333LNG
            End Get
            Set
                Me._plaUnlGOOITE333LNG = Value
            End Set
        End Property

        <XmlElement("PRODOCDC2", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property PRODOCDC2() As List(Of PRODOCDC2Type)
            Get
                Return Me._pRODOCDC2
            End Get
            Set
                Me._pRODOCDC2 = Value
            End Set
        End Property

        <XmlElement("SPEMENMT2", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property SPEMENMT2() As List(Of SPEMENMT2Type)
            Get
                Return Me._sPEMENMT2
            End Get
            Set
                Me._sPEMENMT2 = Value
            End Set
        End Property


        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TRACONCO2() As TRACONCO2Type
            Get
                Return Me._tRACONCO2
            End Get
            Set
                Me._tRACONCO2 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property COMCODGODITM() As COMCODGODITMType
            Get
                Return Me._cOMCODGODITM
            End Get
            Set
                Me._cOMCODGODITM = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TRACONCE2() As TRACONCE2Type
            Get
                Return Me._tRACONCE2
            End Get
            Set
                Me._tRACONCE2 = Value
            End Set
        End Property

        <XmlElement("CONNR2", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property CONNR2() As List(Of CONNR2Type)
            Get
                Return Me._cONNR2
            End Get
            Set
                Me._cONNR2 = Value
            End Set
        End Property

        <XmlElement("IDEMEATRAGI970", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property IDEMEATRAGI970() As List(Of IDEMEATRAGI970Type)
            Get
                Return Me._iDEMEATRAGI970
            End Get
            Set
                Me._iDEMEATRAGI970 = Value
            End Set
        End Property

        <XmlElement("PACGS2", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property PACGS2() As List(Of PACGS2Type)
            Get
                Return Me._pACGS2
            End Get
            Set
                Me._pACGS2 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property PRTNOT640() As PRTNOT640Type
            Get
                Return Me._pRTNOT640
            End Get
            Set
                Me._pRTNOT640 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(GOOITEGDSType))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether PRODOCDC2 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePRODOCDC2() As Boolean
            Return PRODOCDC2 IsNot Nothing AndAlso PRODOCDC2.Count > 0
        End Function

        ''' <summary>
        ''' Test whether SPEMENMT2 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeSPEMENMT2() As Boolean
            Return SPEMENMT2 IsNot Nothing AndAlso SPEMENMT2.Count > 0
        End Function

        ''' <summary>
        ''' Test whether CONNR2 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCONNR2() As Boolean
            Return CONNR2 IsNot Nothing AndAlso CONNR2.Count > 0
        End Function

        ''' <summary>
        ''' Test whether IDEMEATRAGI970 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeIDEMEATRAGI970() As Boolean
            Return IDEMEATRAGI970 IsNot Nothing AndAlso IDEMEATRAGI970.Count > 0
        End Function

        ''' <summary>
        ''' Test whether PACGS2 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePACGS2() As Boolean
            Return PACGS2 IsNot Nothing AndAlso PACGS2.Count > 0
        End Function

        ''' <summary>
        ''' Test whether GroMasGDS46 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeGroMasGDS46() As Boolean
            Return (Equals(_groMasGDS46, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether TRACONCO2 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRACONCO2() As Boolean
            Return (Equals(_tRACONCO2, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether COMCODGODITM should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCOMCODGODITM() As Boolean
            Return (Equals(_cOMCODGODITM, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether TRACONCE2 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTRACONCE2() As Boolean
            Return (Equals(_tRACONCE2, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether PRTNOT640 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePRTNOT640() As Boolean
            Return (Equals(_pRTNOT640, Nothing) <> True)
        End Function

        ''' <summary>
        ''' Test whether IteNumGDS7 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeIteNumGDS7() As Boolean
            Return Not String.IsNullOrEmpty(IteNumGDS7)
        End Function

        ''' <summary>
        ''' Test whether GooDesGDS23 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeGooDesGDS23() As Boolean
            Return Not String.IsNullOrEmpty(GooDesGDS23)
        End Function

        ''' <summary>
        ''' Test whether GooDesGDS23LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeGooDesGDS23LNG() As Boolean
            Return Not String.IsNullOrEmpty(GooDesGDS23LNG)
        End Function

        ''' <summary>
        ''' Test whether MetOfPayGDI12 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeMetOfPayGDI12() As Boolean
            Return Not String.IsNullOrEmpty(MetOfPayGDI12)
        End Function

        ''' <summary>
        ''' Test whether ComRefNumGIM1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeComRefNumGIM1() As Boolean
            Return Not String.IsNullOrEmpty(ComRefNumGIM1)
        End Function

        ''' <summary>
        ''' Test whether UNDanGooCodGDI1 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeUNDanGooCodGDI1() As Boolean
            Return Not String.IsNullOrEmpty(UNDanGooCodGDI1)
        End Function

        ''' <summary>
        ''' Test whether PlaLoaGOOITE333 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaLoaGOOITE333() As Boolean
            Return Not String.IsNullOrEmpty(PlaLoaGOOITE333)
        End Function

        ''' <summary>
        ''' Test whether PlaLoaGOOITE333LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaLoaGOOITE333LNG() As Boolean
            Return Not String.IsNullOrEmpty(PlaLoaGOOITE333LNG)
        End Function

        ''' <summary>
        ''' Test whether PlaUnlGOOITE333 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaUnlGOOITE333() As Boolean
            Return Not String.IsNullOrEmpty(PlaUnlGOOITE333)
        End Function

        ''' <summary>
        ''' Test whether PlaUnlGOOITE333LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePlaUnlGOOITE333LNG() As Boolean
            Return Not String.IsNullOrEmpty(PlaUnlGOOITE333LNG)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize GOOITEGDSType object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes GOOITEGDSType object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output GOOITEGDSType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, GOOITEGDSType)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As GOOITEGDSType) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As GOOITEGDSType
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), GOOITEGDSType)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As GOOITEGDSType
            Return CType(SerializerXml.Deserialize(s), GOOITEGDSType)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current GOOITEGDSType object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an GOOITEGDSType object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output GOOITEGDSType object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, GOOITEGDSType)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As GOOITEGDSType) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As GOOITEGDSType
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As GOOITEGDSType
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class NOTPAR670Type

#Region "Private fields"
        Private _namNOTPAR672 As String

        Private _strNumNOTPAR673 As String

        Private _posCodNOTPAR676 As String

        Private _citNOTPAR674 As String

        Private _couCodNOTPAR675 As String

        Private _nOTPAR670LNG As String

        Private _tINNOTPAR671 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamNOTPAR672() As String
            Get
                Return Me._namNOTPAR672
            End Get
            Set
                Me._namNOTPAR672 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrNumNOTPAR673() As String
            Get
                Return Me._strNumNOTPAR673
            End Get
            Set
                Me._strNumNOTPAR673 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodNOTPAR676() As String
            Get
                Return Me._posCodNOTPAR676
            End Get
            Set
                Me._posCodNOTPAR676 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitNOTPAR674() As String
            Get
                Return Me._citNOTPAR674
            End Get
            Set
                Me._citNOTPAR674 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCodNOTPAR675() As String
            Get
                Return Me._couCodNOTPAR675
            End Get
            Set
                Me._couCodNOTPAR675 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NOTPAR670LNG() As String
            Get
                Return Me._nOTPAR670LNG
            End Get
            Set
                Me._nOTPAR670LNG = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINNOTPAR671() As String
            Get
                Return Me._tINNOTPAR671
            End Get
            Set
                Me._tINNOTPAR671 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(NOTPAR670Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamNOTPAR672 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamNOTPAR672() As Boolean
            Return Not String.IsNullOrEmpty(NamNOTPAR672)
        End Function

        ''' <summary>
        ''' Test whether StrNumNOTPAR673 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrNumNOTPAR673() As Boolean
            Return Not String.IsNullOrEmpty(StrNumNOTPAR673)
        End Function

        ''' <summary>
        ''' Test whether PosCodNOTPAR676 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodNOTPAR676() As Boolean
            Return Not String.IsNullOrEmpty(PosCodNOTPAR676)
        End Function

        ''' <summary>
        ''' Test whether CitNOTPAR674 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitNOTPAR674() As Boolean
            Return Not String.IsNullOrEmpty(CitNOTPAR674)
        End Function

        ''' <summary>
        ''' Test whether CouCodNOTPAR675 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCodNOTPAR675() As Boolean
            Return Not String.IsNullOrEmpty(CouCodNOTPAR675)
        End Function

        ''' <summary>
        ''' Test whether NOTPAR670LNG should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNOTPAR670LNG() As Boolean
            Return Not String.IsNullOrEmpty(NOTPAR670LNG)
        End Function

        ''' <summary>
        ''' Test whether TINNOTPAR671 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINNOTPAR671() As Boolean
            Return Not String.IsNullOrEmpty(TINNOTPAR671)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize NOTPAR670Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes NOTPAR670Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output NOTPAR670Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, NOTPAR670Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As NOTPAR670Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As NOTPAR670Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), NOTPAR670Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As NOTPAR670Type
            Return CType(SerializerXml.Deserialize(s), NOTPAR670Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current NOTPAR670Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an NOTPAR670Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output NOTPAR670Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, NOTPAR670Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As NOTPAR670Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As NOTPAR670Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As NOTPAR670Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class TRACONCE1Type

#Region "Private fields"
        Private _namCE17 As String

        Private _strAndNumCE122 As String

        Private _posCodCE123 As String

        Private _citCE124 As String

        Private _couCE125 As String

        Private _nADLNGCE As String

        Private _tINCE159 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamCE17() As String
            Get
                Return Me._namCE17
            End Get
            Set
                Me._namCE17 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrAndNumCE122() As String
            Get
                Return Me._strAndNumCE122
            End Get
            Set
                Me._strAndNumCE122 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodCE123() As String
            Get
                Return Me._posCodCE123
            End Get
            Set
                Me._posCodCE123 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitCE124() As String
            Get
                Return Me._citCE124
            End Get
            Set
                Me._citCE124 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCE125() As String
            Get
                Return Me._couCE125
            End Get
            Set
                Me._couCE125 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NADLNGCE() As String
            Get
                Return Me._nADLNGCE
            End Get
            Set
                Me._nADLNGCE = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINCE159() As String
            Get
                Return Me._tINCE159
            End Get
            Set
                Me._tINCE159 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCE1Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamCE17 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamCE17() As Boolean
            Return Not String.IsNullOrEmpty(NamCE17)
        End Function

        ''' <summary>
        ''' Test whether StrAndNumCE122 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrAndNumCE122() As Boolean
            Return Not String.IsNullOrEmpty(StrAndNumCE122)
        End Function

        ''' <summary>
        ''' Test whether PosCodCE123 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodCE123() As Boolean
            Return Not String.IsNullOrEmpty(PosCodCE123)
        End Function

        ''' <summary>
        ''' Test whether CitCE124 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitCE124() As Boolean
            Return Not String.IsNullOrEmpty(CitCE124)
        End Function

        ''' <summary>
        ''' Test whether CouCE125 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCE125() As Boolean
            Return Not String.IsNullOrEmpty(CouCE125)
        End Function

        ''' <summary>
        ''' Test whether NADLNGCE should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNADLNGCE() As Boolean
            Return Not String.IsNullOrEmpty(NADLNGCE)
        End Function

        ''' <summary>
        ''' Test whether TINCE159 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINCE159() As Boolean
            Return Not String.IsNullOrEmpty(TINCE159)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize TRACONCE1Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes TRACONCE1Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output TRACONCE1Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCE1Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCE1Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCE1Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCE1Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCE1Type
            Return CType(SerializerXml.Deserialize(s), TRACONCE1Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TRACONCE1Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an TRACONCE1Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output TRACONCE1Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCE1Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCE1Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCE1Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCE1Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class

    <System.CodeDom.Compiler.GeneratedCode("System.Xml", "4.8.9037.0"),
     System.Serializable,
     DebuggerStepThrough,
     DesignerCategoryAttribute("code"),
     XmlType([Namespace]:="http://ics.dgtaxud.ec/CC315A")>
    Partial Public Class TRACONCO1Type

#Region "Private fields"
        Private _namCO17 As String

        Private _strAndNumCO122 As String

        Private _posCodCO123 As String

        Private _citCO124 As String

        Private _couCO125 As String

        Private _nADLNGCO As String

        Private _tINCO159 As String

        Private Shared _serializerXml As XmlSerializer
#End Region

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NamCO17() As String
            Get
                Return Me._namCO17
            End Get
            Set
                Me._namCO17 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property StrAndNumCO122() As String
            Get
                Return Me._strAndNumCO122
            End Get
            Set
                Me._strAndNumCO122 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property PosCodCO123() As String
            Get
                Return Me._posCodCO123
            End Get
            Set
                Me._posCodCO123 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CitCO124() As String
            Get
                Return Me._citCO124
            End Get
            Set
                Me._citCO124 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property CouCO125() As String
            Get
                Return Me._couCO125
            End Get
            Set
                Me._couCO125 = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="token")>
        Public Property NADLNGCO() As String
            Get
                Return Me._nADLNGCO
            End Get
            Set
                Me._nADLNGCO = Value
            End Set
        End Property

        <XmlElement(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
        Public Property TINCO159() As String
            Get
                Return Me._tINCO159
            End Get
            Set
                Me._tINCO159 = Value
            End Set
        End Property

        Private Shared ReadOnly Property SerializerXml() As XmlSerializer
            Get
                If (_serializerXml Is Nothing) Then
                    _serializerXml = New XmlSerializerFactory().CreateSerializer(GetType(TRACONCO1Type))
                End If
                Return _serializerXml
            End Get
        End Property

        ''' <summary>
        ''' Test whether NamCO17 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNamCO17() As Boolean
            Return Not String.IsNullOrEmpty(NamCO17)
        End Function

        ''' <summary>
        ''' Test whether StrAndNumCO122 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeStrAndNumCO122() As Boolean
            Return Not String.IsNullOrEmpty(StrAndNumCO122)
        End Function

        ''' <summary>
        ''' Test whether PosCodCO123 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializePosCodCO123() As Boolean
            Return Not String.IsNullOrEmpty(PosCodCO123)
        End Function

        ''' <summary>
        ''' Test whether CitCO124 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCitCO124() As Boolean
            Return Not String.IsNullOrEmpty(CitCO124)
        End Function

        ''' <summary>
        ''' Test whether CouCO125 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeCouCO125() As Boolean
            Return Not String.IsNullOrEmpty(CouCO125)
        End Function

        ''' <summary>
        ''' Test whether NADLNGCO should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeNADLNGCO() As Boolean
            Return Not String.IsNullOrEmpty(NADLNGCO)
        End Function

        ''' <summary>
        ''' Test whether TINCO159 should be serialized
        ''' </summary>
        Public Overridable Function ShouldSerializeTINCO159() As Boolean
            Return Not String.IsNullOrEmpty(TINCO159)
        End Function

#Region "Serialize/Deserialize"
        ''' <summary>
        ''' Serialize TRACONCO1Type object
        ''' </summary>
        ''' <returns>XML value</returns>
        Public Overridable Overloads Function Serialize(ByVal encoding As System.Text.Encoding) As String
            Dim streamReader As StreamReader = Nothing
            Dim memoryStream As MemoryStream = Nothing
            Try
                memoryStream = New MemoryStream()
                Dim xmlWriterSettings As System.Xml.XmlWriterSettings = New System.Xml.XmlWriterSettings()
                xmlWriterSettings.Encoding = encoding
                xmlWriterSettings.Indent = True
                xmlWriterSettings.IndentChars = "  "
                xmlWriterSettings.NewLineOnAttributes = True
                xmlWriterSettings.OmitXmlDeclaration = True
                Dim xmlWriter As System.Xml.XmlWriter = XmlWriter.Create(memoryStream, xmlWriterSettings)
                SerializerXml.Serialize(xmlWriter, Me)
                memoryStream.Seek(0, SeekOrigin.Begin)
                streamReader = New StreamReader(memoryStream, encoding)
                Return streamReader.ReadToEnd
            Finally
                If (Not (streamReader) Is Nothing) Then
                    streamReader.Dispose()
                End If
                If (Not (memoryStream) Is Nothing) Then
                    memoryStream.Dispose()
                End If
            End Try
        End Function

        Public Overridable Overloads Function Serialize() As String
            Return Serialize(System.Text.Encoding.UTF8)
        End Function

        ''' <summary>
        ''' Deserializes TRACONCO1Type object
        ''' </summary>
        ''' <param name="input">string to deserialize</param>
        ''' <param name="obj">Output TRACONCO1Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCO1Type)
            Try
                obj = Deserialize(input)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String, ByRef obj As TRACONCO1Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return Deserialize(input, obj, exception)
        End Function

        Public Overloads Shared Function Deserialize(ByVal input As String) As TRACONCO1Type
            Dim stringReader As StringReader = Nothing
            Try
                stringReader = New StringReader(input)
                Return CType(SerializerXml.Deserialize(XmlReader.Create(stringReader)), TRACONCO1Type)
            Finally
                If (Not (stringReader) Is Nothing) Then
                    stringReader.Dispose()
                End If
            End Try
        End Function

        Public Overloads Shared Function Deserialize(ByVal s As Stream) As TRACONCO1Type
            Return CType(SerializerXml.Deserialize(s), TRACONCO1Type)
        End Function
#End Region

        ''' <summary>
        ''' Serializes current TRACONCO1Type object into file
        ''' </summary>
        ''' <param name="fileName">full path of outupt xml file</param>
        ''' <param name="exception">output Exception value if failed</param>
        ''' <returns>true if can serialize and save into file; otherwise, false</returns>
        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            Try
                SaveToFile(fileName, encoding)
                Return True
            Catch e As System.Exception
                exception = e
                Return False
            End Try
        End Function

        Public Overridable Overloads Function SaveToFile(ByVal fileName As String, ByRef exception As System.Exception) As Boolean
            Return SaveToFile(fileName, System.Text.Encoding.UTF8, exception)
        End Function

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String)
            SaveToFile(fileName, System.Text.Encoding.UTF8)
        End Sub

        Public Overridable Overloads Sub SaveToFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding)
            Dim streamWriter As StreamWriter = Nothing
            Try
                Dim dataString As String = Serialize(encoding)
                streamWriter = New StreamWriter(fileName, False, encoding)
                streamWriter.WriteLine(dataString)
                streamWriter.Close()
            Finally
                If (Not (streamWriter) Is Nothing) Then
                    streamWriter.Dispose()
                End If
            End Try
        End Sub

        ''' <summary>
        ''' Deserializes xml markup from file into an TRACONCO1Type object
        ''' </summary>
        ''' <param name="fileName">File to load and deserialize</param>
        ''' <param name="obj">Output TRACONCO1Type object</param>
        ''' <param name="exception">output Exception value if deserialize failed</param>
        ''' <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean
            exception = Nothing
            obj = CType(Nothing, TRACONCO1Type)
            Try
                obj = LoadFromFile(fileName, encoding)
                Return True
            Catch ex As System.Exception
                exception = ex
                Return False
            End Try
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type, ByRef exception As System.Exception) As Boolean
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByRef obj As TRACONCO1Type) As Boolean
            Dim exception As System.Exception = Nothing
            Return LoadFromFile(fileName, obj, exception)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String) As TRACONCO1Type
            Return LoadFromFile(fileName, System.Text.Encoding.UTF8)
        End Function

        Public Overloads Shared Function LoadFromFile(ByVal fileName As String, ByVal encoding As System.Text.Encoding) As TRACONCO1Type
            Dim file As FileStream = Nothing
            Dim sr As StreamReader = Nothing
            Try
                file = New FileStream(fileName, FileMode.Open, FileAccess.Read)
                sr = New StreamReader(file, encoding)
                Dim dataString As String = sr.ReadToEnd
                sr.Close()
                file.Close()
                Return Deserialize(dataString)
            Finally
                If (Not (file) Is Nothing) Then
                    file.Dispose()
                End If
                If (Not (sr) Is Nothing) Then
                    sr.Dispose()
                End If
            End Try
        End Function
    End Class
End Namespace
#Enable Warning
