# XML Parsing using PHP {Intermediate}

**URL:** https://forum.kirupa.com/t/xml-parsing-using-php-intermediate/161172
**Category:** programming
**Created:** [September 1, 2005, 2:20pm UTC](https://forum.kirupa.com/t/xml-parsing-using-php-intermediate/161172 "2005-09-01T14:20:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jlyon1515](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jlyon1515](https://forum.kirupa.com/u/jlyon1515)
#### Post date: [September 1, 2005, 2:20pm UTC](https://forum.kirupa.com/t/xml-parsing-using-php-intermediate/161172/1 "2005-09-01T14:20:02Z")

</div>

I’ve got a question in regards to the tutorial “XML Parsing using PHP {Intermediate}” located at [http://www.kirupa.com/web/xml\_php\_parse\_intermediate.htm](http://www.kirupa.com/web/xml_php_parse_intermediate.htm)

I was going to use it for a project I’m doing but the XML isn’t parsing correctly.

Is there a reason why change the XML from this:

\<?xml version=“1.0”?\>  
\<news\>  
\<story\>  
\<headline\>Godzilla Attacks LA!\</headline\>  
\<description\>Equipped with a… \</description\>  
\</story\>  
\</news\>

to something like this:

\<?xml version=“1.0”?\>  
\<news\>  
\<department\>  
\<story\>  
\<headline\>Godzilla Attacks LA!\</headline\>  
\<description\>Equipped with a… \</description\>  
\</story\>  
\</department\>  
\</news\>

would cause the script to no longer work? The script won’t display anything if my xml looks like the second example.

Thanks for any help.
