# `RustyXML.Encoder`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/encoder.ex#L1)

Encodes XML element trees to strings or iodata.

This is the Saxy-compatible encoding module used by `RustyXML.encode!/2`
and `encode_to_iodata/2`.

# `encode!`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/encoder.ex#L13)

```elixir
@spec encode!(
  term(),
  keyword()
) :: String.t()
```

Encode an XML element tree to a string. Raises on errors.

# `encode_to_iodata`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/encoder.ex#L23)

```elixir
@spec encode_to_iodata(
  term(),
  keyword()
) :: iodata()
```

Encode an XML element tree to iodata.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
