diff --git a/services/Helpers/SimpleXmlUtil.php b/services/Helpers/SimpleXmlUtil.php index b7e4170..3180003 100644 --- a/services/Helpers/SimpleXmlUtil.php +++ b/services/Helpers/SimpleXmlUtil.php @@ -28,8 +28,12 @@ class SimpleXmlUtil { public function getInnerXML( $node ) { $innerXML = ''; if ( $node instanceof \SimpleXMLElement ) { - foreach ( dom_import_simplexml( $node )->childNodes as $child ) { - $innerXML .= $child->ownerDocument->saveXML( $child ); + $domElement = dom_import_simplexml( $node ); + + if ( ( $domElement instanceof \DOMElement ) && ( $domElement->hasChildNodes() ) ) { + foreach ( $domElement->childNodes as $child ) { + $innerXML .= $child->ownerDocument->saveXML( $child ); + } } } return $innerXML;