Fixes #542 and #543 Issues with nesting CDATA tags

Fixes #542 and #543
Problems in syndication.php and importing/exporting themes.


Once merged I or the merger will run cherry-pick to apply the changes to the feature branch (pointless having two pull requests for such a simple change).
perpage is saved as integer in the database so the replace isn't necessary here