Or a DOMFS in /dom that's organized in the same hierarchy as the browser DOM. For example, to write a whole page:
echo "...." > /dom
Update the <title> tag: echo "TITLE" > /dom/html/head/title
Change the charset: echo "EBCDIC" > /dom/html/head/meta[1].charset // second <meta> tag
echo "EBCDIC" > /dom/html/head/1.charset // second child of <head>
Even go full XPath and replace a tag's inner HTML: echo "<div>abc</div>" > /dom/[@id='myID']
This is a horrible idea...