For anyone who was also wondering what kind of events this function actually handles:
it's used in cases when an XML comment is found or an additional declaration like an xml-stylesheet. In such cases the data argument contains the whole string as it is, for example:
<!-- this is a comment -->
<?xml-stylesheet title="mystyle" type="text/xsl" href="style.xsl" ?>