SPL contains a class for parsing XML, http://www.php.net/~helly/php/ext/spl/classSimpleXMLIterator.html Although poorly documented so far it looks promising.