# use-xml
Practical XML utility primitives for lightweight declaration, element, attribute, escaping, and comment handling.
> Warning: versions below `0.3.0` are experimental and may change as the crate matures.
## Example Usage
```rust
use use_xml::{extract_root_element, get_attribute, has_xml_declaration, strip_xml_comments};
let input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root id=\"42\"><!-- note --></root>";
let root = extract_root_element(input).unwrap();
assert!(has_xml_declaration(input));
assert_eq!(root.name, "root");
assert_eq!(get_attribute("<root id=\"42\" />", "id"), Some("42".to_string()));
assert_eq!(strip_xml_comments("<root><!-- note --><child /></root>"), "<root><child /></root>");
```
## Scope
- XML declaration detection and conservative extraction
- root element and attribute inspection helpers
- XML escaping, unescaping, and comment stripping
## Non-Goals
- a full XML parser
- XPath support
- XSD validation
- deep namespace resolution
## License
Licensed under either of the following, at your option:
- MIT License
- Apache License, Version 2.0