# PostgreSQL XML data and Elixir / Ecto?

**URL:** <https://forum.elixirforum.com/t/postgresql-xml-data-and-elixir-ecto/71317>\
**Category:** Questions\
**Tags:** ecto, xml\
**Created:** [June 16, 2025, 10:31pm UTC](https://forum.elixirforum.com/t/postgresql-xml-data-and-elixir-ecto/71317 "2025-06-16T22:31:16Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![christhekeele](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/32/1039_2.png) [@christhekeele](https://forum.elixirforum.com/u/christhekeele)\
**Post date:** [June 22, 2025, 8:22pm UTC](https://forum.elixirforum.com/t/postgresql-xml-data-and-elixir-ecto/71317/9 "2025-06-22T20:22:49Z")

</div>

> [@silverdr](#):
>
> I didn’t say it’s not possible but that nothing I found is “full-fledged” as in “handles all both ways”. Things are scattered, and there are bits and pieces here and there – it’s still three different libs, including an Erlang one. I’d dream of something like e. g. `JSON.decode` , `JSON.encode` , as [XML.de/encode](http://xml.de/encode), augmented with `XML.validate` and XML Ecto type.

I agree it’s scattered, but in practice those bits and pieces are well battle-tested, so it becomes hard to rationalize a thin wrapper around them just for convenience’s sake (when you can be production ready with a handful of function calls, or `defdelegate`s if you want to make your own holistic interface).

Not saying we _ **shouldn’t** _ make a nice convenient wrapper—see, for example, the widely popular [ets package](https://hex.pm/packages/ets)—just encouraging you to articulate where you could see such a library substantially adding value, enough to rationalize a new dependency.

That kind of shopping list is what motivates people to strike dirt and create a new library. 🙂 I myself have thought about it before, for example, but ultimately the only two compelling differentiating features I’ve been able to come up with would be an Ecto.Type and streamlining SOAP handling specifically, both of which work just fine as their own stand-alone libraries and do not benefit substantially from being tightly integrated with the other bits and pieces of validation, streaming, building, etc.

The other attractive proposition for a holistic wrapper library would be to improve upon the Elixir ergonomics of working with the erlang libraries’ records. However, since polymorphism isn’t particularly useful in this domain outside of tapping into existing protocols—specifically `Inspect` and `Enumerable`—I’ve found that motivation to be sufficiently lacking to build out a library for that purpose alone.

One day something may tip that scale, and conversations like these are what cause me to `mix new` in my `~/code/oss/elixir` folder more than anything.

---

_[View the full topic](https://forum.elixirforum.com/t/postgresql-xml-data-and-elixir-ecto/71317)._
