How to use xmlbuilder

Comprehensive xmlbuilder code examples:

How to use xmlbuilder.begin:

44
45
46
47
48
49
50
51
52
53
  this.options.date.timezone.enabled = typeof this.options.date.timezone.enabled === 'boolean' ? this.options.date.timezone.enabled : true;
}

jsonToXml(node, nsContext, descriptor, val) {
  if (node == null) {
    node = xmlBuilder.begin(
      {version: '1.0', encoding: 'UTF-8', standalone: true});
  }
  if (nsContext == null) {
    nsContext = new NamespaceContext();

How to use xmlbuilder.create:

396
397
398
399
400
401
402
403
404
405
  }
}

static createSOAPEnvelope(prefix, nsURI) {
  prefix = prefix || 'soap';
  var doc = xmlBuilder.create(prefix + ':Envelope',
    {version: '1.0', encoding: 'UTF-8', standalone: true});
  nsURI = nsURI || 'http://schemas.xmlsoap.org/soap/envelope/';
  doc.attribute('xmlns:' + prefix,
    nsURI);