src/Types/Dom.php
public function set($value)
    {
        if (!is_object($value)) {
            throw new \InvalidArgumentException('Expected an object');
        }

        if ($value instanceof \DOMNode) {
            $value = simplexml_import_dom($value);
        }

        if ($value instanceof \XMLWriter) {
            $value = new \SimpleXMLElement($value->outputMemory(), LIBXML_NONET);
        }

        if (!($value instanceof \SimpleXMLElement)) {
            throw new \InvalidArgumentException('Expected a SimpleXMLElement object');
        }

        $this->value = $value;
    }
public function set($value)
    {
        if (!is_object($value)) {
            throw new \InvalidArgumentException('Expected an object');
        }

        if ($value instanceof \DOMNode) {
            $value = simplexml_import_dom($value);
        }

        if ($value instanceof \XMLWriter) {
            $value = new \SimpleXMLElement($value->outputMemory(), LIBXML_NONET);
        }

        if (!($value instanceof \SimpleXMLElement)) {
            throw new \InvalidArgumentException('Expected a SimpleXMLElement object');
        }

        $this->value = $value;
    }
/ \copydoc fpoirotte::XRL::Types::AbstractType::set()