extern crate quickxml_to_serde; use quickxml_to_serde::{xml_string_to_json, Config, NullValue}; fn main() { let xml = r#"some text"#; let conf = Config::new_with_defaults(); let json = xml_string_to_json(xml.to_owned(), &conf); println!("{}", json.expect("Malformed XML").to_string()); let conf = Config::new_with_custom_values(true, "", "txt", NullValue::Null); let json = xml_string_to_json(xml.to_owned(), &conf); println!("{}", json.expect("Malformed XML").to_string()); }