What XML library should I use to populate the generated structs?
pugixml is the most common choice for new C++ projects — header-only or static lib, MIT licensed, XPath 1.0 support, and a clean DOM API. rapidxml is faster (fully in-place parsing, zero allocation for the DOM) but only handles well-formed XML and has fewer convenience methods. libxml2 is the GNOME C library with the broadest feature set (XSD, RelaxNG, XPath 2.0) but requires linking C bindings. The generated structs work with all three — they are plain data, not bound to any parser.
Are XML attributes distinguishable in the output?
Yes. Each generated field carries an inline comment marking it as either "<- attribute" or "<- <element>". When you wire up pugixml you call node.attribute("id").value() for the attribute fields and node.child("title").text().get() for the element fields — the comment tells you which path applies.
Why std::string instead of std::string_view?
std::string owns its storage and is safe to keep around after the XML buffer is freed. std::string_view points into the original buffer — fast for read-only scanning but a use-after-free bug if the buffer is freed before the view. The generator picks the safe default; switch to string_view yourself if you control buffer lifetime, e.g. with rapidxml in-place parsing.
How are repeated elements like <tag> represented?
Repeated child elements become a std::vector<T> field on the parent struct, with T inferred from the first occurrence. For pugixml, populate via for (auto t : node.child("tags").children("tag")) tags.push_back({t.text().get()}); — the vector grows naturally as you walk the DOM.
What C++ standard is required?
C++11 is sufficient — std::string and std::vector are pre-C++11. If you want aggregate initialization on every struct (Book b = {"id", "lang", ...};) you need C++17 mandatory copy elision and brace-elision rules to be reliable. C++20 designated initializers (Book b = {.id = "bk101", .title = "..."}) make the generated structs even friendlier to construct manually.
How do I serialize back to XML?
pugixml: build the DOM manually with node.append_attribute("id") = book.id.c_str(); and node.append_child("title").text() = book.title.c_str();. There is no automatic reflection in C++ before C++26, so the round-trip code is hand-written. For Boost.Serialization or cereal you can add a serialize() method to each struct.
Is the XML I paste sent to your servers?
No. XML is parsed by the browser DOMParser and the C++ source is generated entirely in JavaScript on your machine. Open DevTools → Network and you will see no requests when you click Convert. Safe for SOAP responses and configuration files containing API keys or credentials.
Why structs instead of classes with private fields?
XML data classes are pure value containers — encapsulation buys nothing because every field is public-by-purpose. struct (which is just class with public default access in C++) signals "data" instead of "behaviour", matches the conventions of pugixml / Boost.PropertyTree, and supports aggregate initialization out of the box. Add a class wrapper if you need invariants or computed methods.