Fixed bug in xmlEncode() method.