Consider this hypothetical xml:
<myApi xmlns="urn:something" xmlns:bla="urn:hello">
<argument1>foo</argument1>
<argument2>
<p xmlns="http://www.w3.org/1999/xhtml">Some paragraph of text. <img src="http://www.example.org/hello.png" bla:test="oi" /></p>
</argument2>
</myApi>
What would be the best way in PHP to parse out the 2nd argument. The full xml-structure must be stored in the database, but consideration has to be made for the fact that it could reference already-declared xml namespaces higher up in the document.
Is there a good way to take out a chunk of XML using any of the readily available PHP parsing libraries, and store all the semantic information?