docs: VoltXMLElement voltGetTableXML(Session session)
              throws org.hsqldb_voltpatches.HSQLInterface.HSQLParseException
      {
          VoltXMLElement table = new VoltXMLElement("table");
  
          // add table metadata
          String tableName = getName().name;
          table.attributes.put("name", tableName);
  
          // read all the columns
          VoltXMLElement columns = new VoltXMLElement("columns");
          columns.attributes.put("name", "columns");
          table.children.add(columns);
          int[] columnIndices = getColumnMap();
          for (int i : columnIndices) {
              ColumnSchema column = getColumn(i);
              VoltXMLElement colChild = column.voltGetColumnXML(session);
              colChild.attributes.put("index", Integer.toString(i));
              columns.children.add(colChild);
              assert(colChild != null);
          }
  
          // read all the constraints
          VoltXMLElement constraints = new VoltXMLElement("constraints");
          constraints.attributes.put("name", "constraints");
          Map<String, VoltXMLElement> indexConstraintMap = new HashMap<>();
          for (Constraint constraint : getConstraints()) {
              VoltXMLElement constraintChild = constraint.voltGetConstraintXML();
              constraints.children.add(constraintChild);
              if (constraintChild.attributes.containsKey("index")) {
                  indexConstraintMap.put(constraintChild.attributes.get("index"), constraintChild);
              }
          }
  
          // read all the indexes
          VoltXMLElement indexes = new VoltXMLElement("indexes");
          indexes.attributes.put("name", "indexes");
          for (Index index : indexList) {
              VoltXMLElement indexChild = index.voltGetIndexXML(session, tableName, indexConstraintMap);
              indexes.children.add(indexChild);
              assert(indexChild != null);
          }
  
          // Indexes must come before constraints when converting to the catalog.
          table.children.add(indexes);
          table.children.add(constraints);
  
          if (timeToLive != null) {
              VoltXMLElement ttl = new VoltXMLElement(TimeToLiveVoltDB.TTL_NAME);
              ttl.attributes.put("name", TimeToLiveVoltDB.TTL_NAME);
              ttl.attributes.put("value", Integer.toString(timeToLive.ttlValue));
              ttl.attributes.put("unit",  timeToLive.ttlUnit);
              ttl.attributes.put("column", timeToLive.ttlColumn.getNameString());
              ttl.attributes.put("maxFrequency", Integer.toString(timeToLive.maxFrequency));
              ttl.attributes.put("batchSize", Integer.toString(timeToLive.batchSize));
              ttl.attributes.put("migrationTarget", timeToLive.migrationTarget);
              table.children.add(ttl);
          }
          assert(indexConstraintMap.isEmpty());
  
          return table;
      }