The module eslsxml.js
exports a macro that reads its arguments as SXML syntax (partially implemented), and outputs a string with the equivalent XML.
This eslisp code (with the first SXML example from Wikipedia)—
(macro sxml (require "./eslsxml.js"))
((. console log)
(sxml
(tag (@ (attr1 "value1")
(attr2 "value2"))
(nested "Text node")
(empty))))
—compiles to JavaScript as—
console.log('<tag attr1="value1" attr2="value2"><nested>Text node</nested><empty></empty></tag>');
The example code could be adapted to return estree objects representing the appropriate function calls at line 41. Eslisp understands the more complex estree spec just as well as its own dead-simple {type: "string", value: 'whatever'}
S-expression AST type.