1--TEST-- 2Interop Test: Import from SimpleXML 3--SKIPIF-- 4<?php require_once('skipif.inc'); ?> 5<?php if (!extension_loaded('simplexml')) die('skip simplexml extension not available');?> 6--FILE-- 7<?php 8$s = simplexml_load_file(__DIR__."/book.xml"); 9if(!$s) { 10 echo "Error while loading the document\n"; 11 exit; 12} 13$dom = dom_import_simplexml($s); 14print $dom->ownerDocument->saveXML(); 15?> 16--EXPECT-- 17<?xml version="1.0"?> 18<books> 19 <book> 20 <title>The Grapes of Wrath</title> 21 <author>John Steinbeck</author> 22 </book> 23 <book> 24 <title>The Pearl</title> 25 <author>John Steinbeck</author> 26 </book> 27</books> 28