I think this is the wrong way to do things. The unescaping should happen after the parsing. Otherwise `<foo>&lt;</foo>` will break. Probably we need to do something like:

```
unescape(er.toxml(), chars=microdom.XML_ESCAPE_CHARS))
```

on any EntityReference nodes we find while creating the parameters from the XML.