PHP AnyXML is an XML read-only class which offers PHP5 SimpleXML's capabilities on ANY host, even if PHP4 and/or without the expat extension.
AnyXML project will always choose the best available library to offer its functionality. Your solution to PHP+XML messes.
AnyXML API documentation
When loading an XML file the first XML tag becomes the root node. An XML file should contain only one parent tag.
Please note that AnyXML offers a read-only layer and no write facility. All child nodes (with the same name) are grouped into arrays.
AnyXML API defines:
returns all the child nodes of the AnyXML object
returns the text value of the AnyXML object; this is the text contained in the tag
or that gathered from its child nodes
returns the tag name of the current AnyXML object
returns an AnyXML object from the specified $path
if the path was not valid, null is returned
if there is more than one element in that path, an array is returned
same as ::getElementByPath($path)->getValue()
* attributes($attr = null)
returns attribute $attr or the full list of attributes if $attr is not specified
* map($callback, $args = array())
maps a callback function to all children