I'd like to create XML documents in a portable way in JavaScript. Coming from a Python background, I'm familiar with libraries like LXML and ElementTree, which give
- Elements are treated as objects, by default, rather than text.
- Documents are always tree-structured. Ie, new elements are typically appended to existing xpaths, having unclosed tags is not possible as elements always close themselves.
- Elements children are iterable
- Namespaces (and perhaps also namespace prefixes) are supported
Essentially, I'm looking for a neat XML creation library that works across browsers. Any recommendations?