# SweetXml

> Query XML in Elixir with XPath sigils

Source: https://talira.ai/catalog/sweetxml-wcrr3x8m
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / parsing / xml](https://talira.ai/categories/developer-tools/parsing/xml), [languages / elixir](https://talira.ai/categories/languages/elixir)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Kbrw](https://talira.ai/orgs/kbrw.md)

SweetXml (the Hex package `sweet_xml`) is a thin Elixir wrapper around Erlang's `:xmerl` that turns XML into Elixir values. You query a document with XPath through the `~x` sigil, with modifiers for lists, text and entities, and `xmap` builds nested maps from several paths at once. It also streams large files, from `File.stream!` or element by element, so a whole document needn't be in memory. It's maintained in the Kbrw GitHub organization under the MIT licence.

## Links

- GitHub: https://github.com/kbrw/sweet_xml
- Docs: https://hexdocs.pm/sweet_xml/

## Problems it solves

- pull values out of an XML document in Elixir
- parse an XML API response into Elixir maps
- read a large XML file in Elixir without loading it all into memory

## Features

- query XML with XPath through the ~x sigil
- map several XPath queries into nested Elixir maps with xmap
- stream large XML files from File.stream! or element by element
- Hex package sweet_xml

## Trust

Overall: 0.39 out of 1.
Signals: maintenance 0.45, adoption 0.52, momentum 0.17, community 0.65, backing 0.30, extensibility 0.00.

- last commit 3 months ago
- 377 GitHub stars
- 40 contributors
- backed by Kbrw

## Alternatives

- [Saxy](https://talira.ai/catalog/saxy-5q4re2nw.md): Fast streaming XML SAX parser and encoder for Elixir
- [Erlsom](https://talira.ai/catalog/erlsom-00ksk4wn.md): XML parser for Erlang: SAX parsing and XML Schema based data binding
- [XML Builder (Elixir)](https://talira.ai/catalog/xml-builder-elixir-6kn7ps42.md): Generate XML in Elixir from tuples and builder functions

## Sources

[^1]: https://github.com/kbrw/sweet_xml/blob/master/LICENSE (checked 27 Nov 2026)
