code: private void writeElements(String currentIndent, String tagName, StringBuilder attrs, SerIterator itemIterator) throws IOException {
          if (itemIterator.metaTypeRequired()) {
              appendAttribute(attrs, METATYPE, itemIterator.metaTypeName());
          }
          if (itemIterator.category() == SerCategory.GRID) {
              appendAttribute(attrs, ROWS, Integer.toString(itemIterator.dimensionSize(0)));
              appendAttribute(attrs, COLS, Integer.toString(itemIterator.dimensionSize(1)));
          }
          if (itemIterator.size() == 0) {
              output.append(currentIndent).append('<').append(tagName).append(attrs).append('/').append('>').append(settings.getNewLine());
          } else {
              output.append(currentIndent).append('<').append(tagName).append(attrs).append('>').append(settings.getNewLine());
              writeElements(currentIndent + settings.getIndent(), itemIterator);
              output.append(currentIndent).append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
          }
      }
docs: -----------------------------------------------------------------------