Added tests for (un)escaping XML and fixed unescaping escaped characters