Improved handling of variables (automatic encoding/cdata applied)