Improved test for XmlEncode