Is the output compatible with serde-xml-rs or quick-xml?
Both. The generator emits #[derive(Debug, Serialize, Deserialize)] structs with serde rename tags using the quick-xml convention: "@name" for attributes and "$text" for inner text. quick-xml with the serialize feature reads these directly. serde-xml-rs uses a slightly different attribute syntax (no @ prefix); switch the rename strings to migrate.
How are XML attributes mapped to Rust struct fields?
XML attributes (e.g. <book id="bk101">) become pub fields annotated with #[serde(rename = "@id")]. The leading @ is the quick-xml convention that tells the deserializer to read from the attribute table on the parent element instead of looking for a child element of the same name.
How are repeated elements like <tag> in <tags> represented?
Repeated child elements become Vec<TagType> fields on the parent struct. quick-xml with serde collects each occurrence into the vector. For wrapped lists (<tags><tag/><tag/></tags>) you may also wrap with #[serde(rename = "tag")] inside an inner struct, depending on shape.
What about XML namespaces?
quick-xml accepts namespace-qualified names in its rename string: #[serde(rename = "ns:localname")]. The basic generator strips the namespace prefix; for namespace-aware deserialization rewrite the tag with the prefix or use quick-xml low-level reader to handle namespaces explicitly.
Can elements with both attributes and text content be modeled?
Yes. <price currency="USD">54.99</price> generates a Price struct with two fields — currency annotated with #[serde(rename = "@currency")] and a text field annotated with #[serde(rename = "$text")]. quick-xml decodes the text body into the $text field while reading the attribute separately.
Does the output use Option<T> for nullable fields?
Fields whose source value is null become Option<String>. For other types you can change to Option<T> manually if the element is optional in your schema. Without Option, missing elements cause a deserialization error — a feature, not a bug, when you want strict parsing.
Is the XML I paste sent to your servers?
No. XML is parsed by the browser DOMParser and the Rust code 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.
How do I deserialize XML into the generated struct?
With quick-xml: use quick_xml::de::from_str; let book: Book = from_str(&xml_string)?; — the renamed fields are populated automatically. Add quick-xml = { version = "0.31", features = ["serialize"] } and serde = { version = "1", features = ["derive"] } to Cargo.toml.