regular text here, > needs to be escaped as <

by spliting it into 2 different CDATA sections]]>
#### #!/bin/perl -w use strict; use XML::Twig; my $t= XML::Twig->new( ); $t->parse( \*DATA); foreach my $cdata ( $t->descendants( '#CDATA')) { $cdata->set_pcdata( $cdata->cdata); $cdata->set_gi( '#PCDATA'); } $t->print; __DATA__

regular text here, < needs to be escaped as &lt;