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

XML building DSL for constructing XML documents programmatically.

Drop-in replacement for `Saxy.XML`.

## Example

    import RustyXML.XML

    doc = element("person", [{"id", "1"}], [
      element("name", [], ["John Doe"]),
      element("email", [], ["john@example.com"])
    ])

    RustyXML.encode!(doc)
    #=> "<person id=\"1\"><name>John Doe</name><email>john@example.com</email></person>"

# `content`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L21)

```elixir
@type content() :: String.t() | {:cdata, String.t()} | element()
```

# `element`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L22)

```elixir
@type element() :: {:element, String.t(), [{String.t(), String.t()}], [content()]}
```

# `cdata`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L50)

```elixir
@spec cdata(String.t()) :: {:cdata, String.t()}
```

Create a CDATA section.

# `characters`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L44)

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

Create a text content node.

# `element`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L28)

```elixir
@spec element(String.t(), [{String.t(), String.t()}], [content()]) :: element()
```

Create an XML element with children.

# `empty_element`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L36)

```elixir
@spec empty_element(String.t(), [{String.t(), String.t()}]) :: element()
```

Create an empty (self-closing) XML element.

# `processing_instruction`
[🔗](https://github.com/jeffhuen/rustyxml/blob/v0.2.3/lib/rusty_xml/xml.ex#L57)

```elixir
@spec processing_instruction(String.t(), String.t()) ::
  {:processing_instruction, String.t(), String.t()}
```

Create a processing instruction.

---

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