18 if (is_object( $oInput )) {
19 $aObjectVars = get_object_vars( $oInput );
20 } elseif (is_array($oInput) ) {
21 $aObjectVars = $oInput;
26 foreach ($aObjectVars as $sKey => $oVar) {
27 if (is_object( $oVar ) ) {
28 $oChildNode = $oXml->addChild($sKey);
30 } elseif (is_array( $oVar) ) {
31 foreach ($oVar as $oSubValue) {
34 if (is_array($oSubValue) || is_object($oSubValue)) {
35 $oChildNode = $oXml->addChild($sKey);
38 $oXml->addChild($sKey, $oSubValue);
43 $oXml->addChild($sKey, $oVar);
78 $oXml =
new SimpleXMLElement(
"<?xml version=\"1.0\" encoding=\"utf-8\"?><$sDocument/>");
81 return $oXml->asXml();
93 return simplexml_load_string($sXml);