How can I, if possible at all, programmatically edit xml data in Emacs Lisp?
What I need to do, is to programmatically add new nodes into arbitrary locations in the xml:
<root>
<child>
</child>
</root>
(xml-add-element xml "hello" (xml-element-by-tagname xml "child"))
<root>
<child>
<hello></hello>
</child>
</root>
Edit: I got as far as parsing the xml into a lisp structure and editing it with xml.el and dom.el, but now I need to turn the lisp structure back into xml data.
here’s my version for converting s-expressions created from xml-parse* functions back into xml strings. Hope it’s helpful!
https://github.com/upgradingdave/xml-to-string