# libxml2

> XML toolkit in C, originally developed for GNOME

Source: https://talira.ai/catalog/libxml2-knq7x8pt
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Command-line tool
- Categories: [libraries / xml](https://talira.ai/categories/libraries/xml), [languages / c](https://talira.ai/categories/languages/c)
- Licence: MIT[^2][^3]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [The Libxml2 Contributors](https://talira.ai/orgs/libxml2.md)

libxml2 is an XML toolkit written in C, originally developed for the GNOME Project and maintained by volunteers. It parses and serialises XML and HTML, and supports XPath, XInclude, XML Catalogs, Canonical XML, RELAX NG, XML Schemas 1.0 and Schematron, with optional Python bindings and the xmllint command-line tool. It builds with GNU Autotools, CMake or Meson.

## Links

- Repository: https://gitlab.gnome.org/GNOME/libxml2
- Docs: https://gitlab.gnome.org/GNOME/libxml2/-/wikis

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/libxml2>[^1]

## Problems it solves

- parse and validate XML documents against an XML Schema from C code
- a fast C library to read HTML and query it with XPath
- validate XML files against RELAX NG from the command line
- the standard XML parser that other languages' bindings build on

## Features

- XML and HTML parsers with serialisation
- RELAX NG and XML Schemas 1.0 validation, Schematron optional
- Canonical XML 1.0 and XML Catalogs
- optional Python bindings
- xmllint command-line tool
- builds with Autotools, CMake or Meson

## Limitations

- Its maintainers don't recommend using it to process untrusted data, and security bugs are handled on a best-effort basis by volunteers[^2]

## Trust

Overall: 0.32 out of 1.
Signals: adoption 0.68, backing 0.30, extensibility 0.00.

- 5k Homebrew installs in 30 days
- backed by The Libxml2 Contributors

Warnings:

- activity not tracked: Talira doesn't read repositories on gitlab.gnome.org yet

## Alternatives

- [roxmltree](https://talira.ai/catalog/roxmltree-g2rdq18a.md): Represent an XML as a read-only tree.

## Sources

[^1]: https://formulae.brew.sh/formula/libxml2 (checked 29 Nov 2026)
[^2]: https://github.com/GNOME/libxml2/blob/master/README.md (checked 29 Nov 2026)
[^3]: https://github.com/GNOME/libxml2/blob/master/Copyright (checked 29 Nov 2026)
