20 $buff =
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
22 foreach($xml as $nodeName => $nodeItem)
37 foreach($node as $key => $value)
41 case 'node_name' :
break;
46 foreach($value as $attrName => $attrValue)
48 $attrs .= sprintf(
' %s="%s"', $attrName, htmlspecialchars($attrValue, ENT_COMPAT | ENT_HTML401,
'UTF-8',
false));
59 foreach($value as $idx => $arrNode)
64 else if(is_object($value))
71 return sprintf(
'<%s%s>%s</%s>' .
"\n", $node->node_name, $attrs, $body, $node->node_name);