output text/plain

var testSet = {
  attrEmptyObject @(a: 'x'): {},
  attrEmptyArray @(a: 'x'): [],
  emptyObject: {},
  emptyArray: [],
  nullValue: null,
  emptyString: "",
  attrNullValue @(a: 'x'): null
}

fun print(options) =
  write({
    test: {
      options: options,
      result: testSet
    }
  }, 'text/xml', options)

---
[
  print({

  }),
  print({
    encoding: "UTF-8",
    inlineCloseOn: "never",
    writeDeclaration: false
  }),
  print({
    encoding: "UTF-8",
    inlineCloseOn: "empty",
    writeDeclaration: false
  }),
  print({
    encoding: "UTF-8",
    inlineCloseOn: "empty",
    writeDeclaration: false,
    writeNilOnNull: true
  }),
  print({
    encoding: "UTF-8",
    inlineCloseOn: "empty",
    writeDeclaration: false,
    skipNullOn: "everywhere"
  })
] joinBy '\n'