# `Lather.Xml.Builder`
[🔗](https://github.com/awksedgreep/lather/blob/v1.0.49/lib/lather/xml/builder.ex#L1)

XML builder for creating SOAP envelopes.

Provides functionality to build XML documents from Elixir data structures,
specifically optimized for SOAP envelope construction.

# `build`

```elixir
@spec build(map() | [{String.t() | atom(), any()}]) ::
  {:ok, String.t()} | {:error, any()}
```

Builds XML from the given data structure.

## Parameters

* `data` - Elixir data structure (map) to convert to XML

## Examples

    iex> {:ok, xml} = Lather.Xml.Builder.build(%{"soap:Envelope" => %{"soap:Body" => %{"operation" => %{}}}})
    iex> String.contains?(xml, "<soap:Envelope>")
    true
    iex> String.contains?(xml, "<operation/>")
    true

# `build_fragment`

```elixir
@spec build_fragment(map() | [{String.t() | atom(), any()}]) ::
  {:ok, String.t()} | {:error, any()}
```

Builds XML from a data structure without XML declaration.

Useful for building fragments that will be embedded in larger documents.

# `build_xml_string`

```elixir
@spec build_xml_string(map() | [{String.t() | atom(), any()}]) :: String.t()
```

Builds XML string from a map structure.

# `escape_text`

```elixir
@spec escape_text(String.t()) :: String.t()
```

Escapes XML special characters in text content.

---

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