Back to browse
GitHub Repository

A pure Rust reimplementation of libxml2

78 starsRust

Xmloxide – an agent made rust replacement for libxml2

by jawiggins·Feb 28, 2026·64 points·64 comments

AI Analysis

●●●BangerWizardryZero to One

Unmaintained libxml2 replaced with memory-safe Rust, 1727/1727 W3C tests pass, C API compatible.

Strengths
  • 100% W3C conformance + zero unsafe in public API is a genuinely hard constraint satisfied.
  • Memory safety + error recovery (malformed XML still parses) solves libxml2's security liability.
  • Full feature parity (DTD, XPath, XSD, SAX2, XInclude, XML Catalogs, xmllint CLI) is comprehensive, not toy.
Weaknesses
  • libxml2 is infrastructure — small audience, though critical. Not a 'show friends' moment for general devs.
  • Performance vs C implementation unproven; production adoption will depend on benchmarks.
Target Audience

Systems programmers, Rust maintainers, C/C++ projects migrating from libxml2

Similar To

tree-sitter · quick-xml · Expat

Post Description

Recently several AI labs have published experiments where they tried to get AI coding agents to complete large software projects.

- Cursor attempted to make a browser from scratch: https://cursor.com/blog/scaling-agents

- Anthropic attempted to make a C Compiler: https://www.anthropic.com/engineering/building-c-compiler

I have been wondering if there are software packages that can be easily reproduced by taking the available test suites and tasking agents to work on projects until the existing test suites pass.

After playing with this concept by having Claude Code reproduce redis and sqlite, I began looking for software packages where an agent-made reproduction might actually be useful.

I found libxml2, a widely used, open-source C language library designed for parsing, creating, and manipulating XML and HTML documents. Three months ago it became unmaintained with the update, "This project is unmaintained and has [known security issues](https://gitlab.gnome.org/GNOME/libxml2/-/issues/346). It is foolish to use this software to process untrusted data.".

With a few days of work, I was able to create xmloxide, a memory safe rust replacement for libxml2 which passes the compatibility suite as well as the W3C XML Conformance Test Suite. Performance is similar on most parsing operations and better on serialization. It comes with a C API so that it can be a replacement for existing uses of libxml2.

- crates.io: https://crates.io/crates/xmloxide

- GitHub release: https://github.com/jonwiggins/xmloxide/releases/tag/v0.1.0

While I don't expect people to cut over to this new and unproven package, I do think there is something interesting to think about here in how coding agents like Claude Code can quickly iterate given a test suite. It's possible the legacy code problem that COBOL and other systems present will go away as rewrites become easier. The problem of ongoing maintenance to fix CVEs and update to later package versions becomes a larger percentage of software package management work.

Similar Projects