Python and XML with lxml

Python is where most pipelines meet XML, and lxml 3,063 (github.com/lxml/lxml (https://github.com/lxml/lxml 3,063 ), BSD-3-Clause) is the library they use: the ElementTree API on top of libxml2 3,427 and libxslt 3,427 , with XPath 1.0, XSLT 1.0, XSD 1.0, RELAX NG and Schematron. The current release is 6.1.3 (2 September 2026; 7.0 is in beta). Its wheel bundles its own libxml2, here 2.14.6 next to the system's 2.15.2, which the second command reports:

Installing lxml and checking the bundled C librariesPython
~/de-venv/bin/pip install --quiet lxml==6.1.3
~/de-venv/bin/python -c 'from lxml import etree
print(etree.LXML_VERSION, etree.LIBXML_VERSION, etree.LIBXSLT_VERSION)'
Output
(6, 1, 3, 0) (2, 14, 6) (1, 1, 43)

Subsections