1# serde-xml-rs 2 3[](https://travis-ci.org/RReverser/serde-xml-rs) 4 5`xml-rs` based deserializer for Serde (compatible with 1.0) 6 7## Example usage 8 9```rust 10use serde::{Deserialize, Serialize}; 11use serde_xml_rs::{from_str, to_string}; 12 13#[derive(Debug, Serialize, Deserialize, PartialEq)] 14struct Item { 15 name: String, 16 source: String, 17} 18 19fn main() { 20 let src = r#"<Item><name>Banana</name><source>Store</source></Item>"#; 21 let should_be = Item { 22 name: "Banana".to_string(), 23 source: "Store".to_string(), 24 }; 25 26 let item: Item = from_str(src).unwrap(); 27 assert_eq!(item, should_be); 28 29 let reserialized_item = to_string(&item).unwrap(); 30 assert_eq!(src, reserialized_item); 31} 32``` 33