## The DOM API

libzeep uses a modern C++ way of accessing and manipulating data. To give an idea have a look at the following code.

    int main()
    {
        using namespace zeep::xml::literals;

        auto doc =
            R"(<persons>
                <person id="1">
                    <firstname>John</firstname>
                    <lastname>Doe</lastname>
                </person>
                <person id="2">
                    <firstname>Jane</firstname>
                    <lastname>Jones</lastname>
                </person>
            </persons>)"_xml;

        for (auto& person: doc.find("//person"))
        {
            std::string firstname, lastname;

            for (auto& name: *person)
            {
                if (name.name() == "firstname")	firstname = name.str();
                if (name.name() == "lastname")	lastname = name.str();
            }

            std::cout << person->get_attribute("id") << ": " << lastname << ", " << firstname << std::endl;
        }

        return 0;
    }

| Construct an XML document in memory using a string literal
| Iterate over an XPath result set
| Iterate over the `zeep::xml::element` nodes inside the person `zeep::xml::element`

#### XML nodes

The class `zeep::xml::node` is the base class for all classes in the DOM API. The class is not copy constructable and subclasses use move semantics to offer a simple API while still being memory and performance efficient. Nodes can have siblings and a parent but no children.

The class `zeep::xml::element` is the main class, it implements a full XML node with child nodes and attributes. The children are stored as a linked list and same goes for the attributes.

The class `zeep::xml::text` contains the text between XML elements. A `zeep::xml::cdata` class is derived from `zeep::xml::text` and other possible child nodes for an XML element are `zeep::xml::processing_instruction` and `zeep::xml::comment`.

XML elements also contain attributes, stored in the __attribute__ class. Namespace information is stored in these attributes as well. Attributes support structured binding, so the following works:

    zeep::xml::attribute a("x", "1");
    auto& [name, value] = a; // name == "x", value == "1"