# xml/pretty
Convert a Deft value to indented XML. Accepts the same shapes and applies
the same rules as `xml/stringify`.
## Syntax
[xml/pretty $v ?indent]
## Parameters
- `$v` — an element in compact or tree shape
- `?indent` — optional indent string (default two spaces)
## Examples
set doc [xml/parse "<order id=\"A1\"><customer>Ada</customer><paid/></order>" %{ :compact false }] echo [xml/pretty $doc] # <order id="A1"> # <customer>Ada</customer> # <paid/> # </order> [xml/pretty %{ "a" %{ "b" %{ "c" %{} } } } "--"] # <a> # --<b> # ----<c/> # --</b> # </a>
## Returns
Indented XML, or `%Err{:message}` for values that cannot be represented.
Element-only content is written one child per line; an element that
contains text stays on one line, so indentation never changes character
data. The compact shape is an unordered map — use the tree shape when
sibling order matters.
## See Also
`xml/stringify`, `xml/parse`, `xml/load`