Then I use an org.w3c.dom.DocumentBuilder to parse this into an org.w3c.dom.Document. Let's say I store this Document in the variable doc. How can I do something like this:
doc.setVariable("foo", "bar");
so the document the Document represents ends up as this?