The weird thing is that at last in the exported entities.xml confluence really inserts a space after all ]], no matter if inside a CDATA or not. (Then I have not been able to  create somethig with an ]] inside an attribute to see if it happens there, too. (Test case shows this (maybe) : the input xml contains a <p>[[plain]] text</p> which inside confluence is actually rendered as one word (i.e. [[plain]]text )  

On second thought this "repairing" is going on in the parser here, while the "add space after ]]" only happens in the exported entities.xml ... maybe this "fixing" should be done in the ConfluenceInputWikiStream in the wikistream-module instead, as this broken stuff is actually not in the confluence/xhtml format, but happens on export. (I.e. if looking at the stored data inside confluence, there is no extra spaces after ]], they get added on export.)