This is a genuinely useful function, however, as with any DOM-based markup parser, be mindful of the size of the XML document you are parsing. Representing very large XML files as object structures requires *a lot* of memory and processing, and may even crash your server (which is what happened to my Apache when I tried parsing a 2MB XML file using this function, just for fun... ;).