title: XML in COBOL with nested tables and varying children
body: <p>Is it possible to use XML GENERATE to create XML with multi-level nested elements of different sizes?</p>
  
  <p>For example:</p>
  
  <pre><code>01  SOURCE-REC.
      05  REPEATING-PARENT OCCURS 5 TIMES.
          10  PARENT-NAME PIC X(7).
          10  CHILD-COUNT PIC 9.
          10  REPEATING-CHILD OCCURS 1 TO 5 TIMES
                  DEPENDING ON CHILD-COUNT.
              15  CHILD-NAME PIC X(6).
  </code></pre>
  
  <p>Compiling this using Enterprise Cobol v4.1 yields:</p>
  
  <p>IGYGR1263-S "OCCURS DEPENDING ON" object "CHILD-COUNT" was defined as a table
              element.  The "DEPENDING ON" phrase was discarded.</p>
  
  <p>IGYGR1116-S The "DEPENDING ON" object for table "REPEATING-CHILD" was invalid.  The
              "DEPENDING ON" phrase was discarded.</p>
  
  <p>Not all parents are going to have the same number of children.  How can this be addressed?</p>
  
  <p>Edit: I suppose at its heart, this isn't really an XML question.  I hit a wall just trying to build the working storage that I later hope to feed into XML GENERATE.</p>