The expat parser, that the XML functions in PHP use, works by generating calls to the appropriate element handling functions (or methods in a class) as the sequential parsing of the input document occurs.

<title level='1'> SDPHP </title>

<title level='1'> SDPHP </title>

<title level='1'> SDPHP </title>