# Convert from Elixir code to XML

**URL:** <https://forum.elixirforum.com/t/convert-from-elixir-code-to-xml/29717>\
**Category:** Questions\
**Tags:** erlang, development, learning-elixir\
**Created:** [March 9, 2020, 8:53am UTC](https://forum.elixirforum.com/t/convert-from-elixir-code-to-xml/29717 "2020-03-09T08:53:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzah](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/g/f07891/32.png) [@gzah](https://forum.elixirforum.com/u/gzah)\
**Post date:** [March 9, 2020, 8:53am UTC](https://forum.elixirforum.com/t/convert-from-elixir-code-to-xml/29717/1 "2020-03-09T08:53:04Z")

</div>

Is it possible to convert a file made up of Elixir code into an XML file, or better into a pretty printed Abstract Syntax Tree ?

---

<div class="post-metadata">

**Author:** ![mat-hek](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mat-hek/32/38168_2.png) [@mat-hek](https://forum.elixirforum.com/u/mat-hek)\
**Post date:** [March 9, 2020, 9:49am UTC](https://forum.elixirforum.com/t/convert-from-elixir-code-to-xml/29717/2 "2020-03-09T09:49:17Z")

</div>

Maybe this way:

```elixir
pretty_printed_ast = File.read!(path_to_file) |> Code.string_to_quoted!() |> inspect(pretty: true)

```

---

<div class="post-metadata">

**Author:** ![hauleth](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/32/18942_2.png) [@hauleth](https://forum.elixirforum.com/u/hauleth)\
**Post date:** [March 9, 2020, 9:50am UTC](https://forum.elixirforum.com/t/convert-from-elixir-code-to-xml/29717/3 "2020-03-09T09:50:49Z")

</div>

In theory it is possible, the question is - what for? Especially the representation of Elixir code as a XML file.
