Better Xml Entity handling on neko

Attempt at fixing #2739 where a roundtrip of `String=>Xml=>String` resulted in broken entity encoding.  This fixes (and adds tests for) a basic use case, but still fails on an advanced use case.

I would be interested in feedback on if this is possible to specify, or if it is better to be documented as unspecified.