# `roxml::XmlReader`
The `XmlReader` is designed to read xml in an efficient way without any DOM or other intermediate structures.<br/>

## Usage

```rust
extern crate roxml;
use roxml::{XmlElementType, XmlReader};

let xml = r#"<note priority="high">
    <to>Alice</to>
    <from>Bob</from>
    <body>Don't forget to feed the cat.</body>
</note>"#;

let reader = XmlReader::parse(xml);
let root = reader.root_element().expect("well-formed XML has a root");

assert_eq!(root.tag_name(), "note");
assert_eq!(root.attribute("priority"), Some("high"));

for child in root.children() {
    if child.element_type() != XmlElementType::Element {
        continue;
    }
    // Each child's text content is its first (Text) child node.
    let text = child.first_child().map(|n| n.text()).unwrap_or("");
    match child.tag_name() {
        "to"   => assert_eq!(text, "Alice"),
        "from" => assert_eq!(text, "Bob"),
        "body" => assert_eq!(text, "Don't forget to feed the cat."),
        _      => unreachable!(),
    }
}
```

## License

Licensed under either of
 * Apache License, Version 2.0 [LICENSE-APACHE](LICENSE-APACHE) or [source](http://www.apache.org/licenses/LICENSE-2.0)
 * MIT license [LICENSE-MIT](LICENSE-MIT) or [source](http://opensource.org/licenses/MIT)

at your option.

### Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above,
without any additional terms or conditions.
