title: Is there a function to write/export values of list-/class items?
body: <p>From an external application data is extracted and written to a list with several sublist items, here is an example narrowed down to the main list creation:</p>
  <pre><code>Public Class clMain
      Public lsLevel_1 As New List(Of clLevel_1)
  End Class
  
  Public Class clLevel_1
      Public sgName As String
      Public lsLevel_2 As New List(Of clLevel_2)
  End Class
  
  Public Class clLevel_2
      Public sgName As String
      Public lsLevel_3 As New List(Of clLevel_3)
  End Class
  
  Public Class clLevel_3
      Public sgName As String
      Public sgComment As String
  End Class
  
  Module Code
      Sub Main()
          Dim lv_clMain As clMain = New clMain
          For lv_i16Level_1 = 10 To 11
              Dim lv_clLevel_1 As New clLevel_1
              lv_clLevel_1.sgName = &quot;Level 1: &quot; &amp; lv_i16Level_1
              For lv_i16Level_2 = 20 To 21
                  Dim lv_clLevel_2 As New clLevel_2
                  lv_clLevel_2.sgName = &quot;Level 2: &quot; &amp; lv_i16Level_2
                  For lv_i16Level_3 = 30 To 31
                      Dim lv_clLevel_3 As New clLevel_3
                      lv_clLevel_3.sgName = &quot;Level 3: &quot; &amp; lv_i16Level_3
                      lv_clLevel_2.lsLevel_3.Add(lv_clLevel_3)
                  Next
                  lv_clLevel_1.lsLevel_2.Add(lv_clLevel_2)
              Next
              lv_clMain.lsLevel_1.Add(lv_clLevel_1)
          Next
      End Sub
  End Module
  </code></pre>
  <p>Once the list has been &quot;filled&quot;, I would like to write/export the values to a file. What would be a good approach for this tasks? I think creating a function with <code>lv_clMain</code> as parameter. But as <code>lv_clMain</code> is not a collection type, and it can contain several entries of <code>lsLevel_1</code> I am somewhat lost about the correct approach.</p>