# What changed in xmlbuilder2

> 10 changes in xmlbuilder2 3 to 4 from its official release notes, upgrade guides and advisories: 3 breaking, 1 new APIs and options. Each one cited. Sources checked 2026-10-23. HTML: https://unstale.sh/npm/xmlbuilder2/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## xmlbuilder2 4

### Breaking changes

- The minimum required Node.js version is now 20. (4.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/9617fcf922a8701c6a1aa6c57fe1781a374760b4/CHANGELOG.md#400---2025-10-08)

### Fixes and other changes

- Text-only element nodes are no longer printed on new lines in callback mode. (4.0.3) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/9617fcf922a8701c6a1aa6c57fe1781a374760b4/CHANGELOG.md#403---2025-11-01)
- The minified browser bundle was added back. (4.0.2) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/9617fcf922a8701c6a1aa6c57fe1781a374760b4/CHANGELOG.md#402---2025-11-01)
- Attributes are no longer grouped when the group option is not set. (4.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/9617fcf922a8701c6a1aa6c57fe1781a374760b4/CHANGELOG.md#400---2025-10-08)

## xmlbuilder2 3

### Breaking changes

- Support for node.js 10 was removed. (3.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/HEAD/CHANGELOG.md)
- The noDoubleEncoding flag was removed from serializers; parsers now decode predefined entities. (3.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/HEAD/CHANGELOG.md)

### New APIs and options

- Added the import function to the callback API. (3.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/HEAD/CHANGELOG.md)

### Fixes and other changes

- The XML parser now consistently returns the last top level element node created. (3.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/HEAD/CHANGELOG.md)
- The JS object parser now parses mixed content. (3.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/HEAD/CHANGELOG.md)
- Parsers now decode predefined entities. (3.0.0) — [release notes](https://github.com/oozcitak/xmlbuilder2/blob/HEAD/CHANGELOG.md)
