# `SiteMaps.XML`
[🔗](https://github.com/marcosgz/site_maps_ex/blob/v0.1.0/lib/site_maps/xml.ex#L1)

iodata rendering of urlsets and sitemap indexes.

Only set values are written, every text and attribute is escaped, and child elements follow
the order of the sitemap, image, video and news XSDs.

# `escape`

```elixir
@spec escape(String.t()) :: iodata()
```

Escapes the five XML entities and drops characters that are not allowed in XML 1.0
(control characters and invalid UTF-8).

    iex> SiteMaps.XML.escape("a&b <c> \"d\" 'e'") |> IO.iodata_to_binary()
    "a&amp;b &lt;c&gt; &quot;d&quot; &apos;e&apos;"

# `index_entry`

```elixir
@spec index_entry(SiteMaps.IndexEntry.t()) :: iodata()
```

One `<sitemap>` entry of an index.

# `index_footer`

```elixir
@spec index_footer() :: iodata()
```

Closing `</sitemapindex>`.

# `index_header`

```elixir
@spec index_header(SiteMaps.Config.t()) :: iodata()
```

XML declaration, optional stylesheet instruction and the opening `<sitemapindex>`.

# `url`

```elixir
@spec url(SiteMaps.URL.t(), SiteMaps.Config.t()) :: iodata()
```

One `<url>` entry. `default_changefreq` and `default_priority` of `config` apply when the
entry has no value of its own.

# `urlset_footer`

```elixir
@spec urlset_footer() :: iodata()
```

Closing `</urlset>`.

# `urlset_header`

```elixir
@spec urlset_header(SiteMaps.Config.t()) :: iodata()
```

XML declaration, optional stylesheet instruction and the opening `<urlset>` with every namespace.

---

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