When creating XML I'm wondering why the CDATA blocks are uses rather than just escaping the data. Is there something allowed in a CDATA block that can't be escaped and placed in a regular tag?

```
<node><![CDATA[ ...something... ]]></node>

```

instead of

```
<node>...something...</node>

```

Naturally you would need to escape the data in either case:

```
function xmlspecialchars($text)
{
    return str_replace('&#039;', '&apos;', htmlspecialchars($text, ENT_QUOTES, 'utf-8'));
}

```

From the [spec](http://www.w3.org/TR/REC-xml/#sec-cdata-sect) it seems that CDATA was just a posible solution when you don't the option to escape the data - yet you still trust it. For example, a RSS feed from your blog (that for some reason or another can't escape entities).