src/OP/API.php
static function checkCreateXml($str)
    {
        $dom = new DOMDocument;
        $dom->encoding = 'utf-8';

        $textNode = $dom->createTextNode($str);

        if (!$textNode) {
            return false;
        }

        $element = $dom->createElement('element')
            ->appendChild($textNode);

        if (!$element) {
            return false;
        }

        @$dom->appendChild($element);

        $xml = $dom->saveXML();

        return !empty($xml);
    }
static function checkCreateXml($str)
    {
        $dom = new DOMDocument;
        $dom->encoding = 'utf-8';

        $textNode = $dom->createTextNode($str);

        if (!$textNode) {
            return false;
        }

        $element = $dom->createElement('element')
            ->appendChild($textNode);

        if (!$element) {
            return false;
        }

        @$dom->appendChild($element);

        $xml = $dom->saveXML();

        return !empty($xml);
    }
Check if xml was created successfully with $str
@param $str string
@return boolean