Fixes #542 #543 - issues with nesting CDATA tags

Fixes this in more locations...