Fixed text decoding
Added xml-encode function
Fixed bad parameter references for size entities