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

Protocol for converting Elixir data structures to XML.

Drop-in replacement for `Saxy.Builder`.

## Manual Implementation

    defimpl RustyXML.Builder, for: MyStruct do
      import RustyXML.XML

      def build(%MyStruct{name: name, id: id}) do
        element("person", [{"id", to_string(id)}], [
          element("name", [], [name])
        ])
      end
    end

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

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `build`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/builder.ex#L26)

```elixir
@spec build(term()) ::
  RustyXML.XML.element() | String.t() | [RustyXML.XML.element() | String.t()]
```

Convert a term to an XML element structure suitable for `RustyXML.encode!/1`.

---

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