Wraps a text fragment in a CDATA section and removes escaping from characters if necessary.