--TEST-- Bug #38354 (Unwanted reformatting of XML when using AsXML) --SKIPIF-- --FILE-- Item Two ' ); foreach ($xml->xpath("//*") as $element) { var_dump($element->asXML()); } echo "Done\n"; ?> --EXPECT-- string(101) " Item Two " string(62) "Item Two" string(25) "Item Two" Done