public function toSimpleXML($applystyles = true)
    {
        if ($applystyles && !empty($this->styles)) {
            $dom = $this->toDOM($applystyles);

            return simplexml_import_dom($dom);
        }

        switch ($this->sourceType) {
            case self::SOURCE_TYPE_DOM:
                return simplexml_import_dom($this->source);
            case self::SOURCE_TYPE_SIMPLEXML:
                return $this->source;
            case self::SOURCE_TYPE_OBJECT:
                $dom = $this->objectToDom($this->source);

                return simplexml_import_dom($dom);
            case self::SOURCE_TYPE_FILE:
                return simplexml_load_file($this->source);
            case self::SOURCE_TYPE_STRING:
                return simplexml_load_string($this->source);
        }
    }
public function toSimpleXML($applystyles = true)
    {
        if ($applystyles && !empty($this->styles)) {
            $dom = $this->toDOM($applystyles);

            return simplexml_import_dom($dom);
        }

        switch ($this->sourceType) {
            case self::SOURCE_TYPE_DOM:
                return simplexml_import_dom($this->source);
            case self::SOURCE_TYPE_SIMPLEXML:
                return $this->source;
            case self::SOURCE_TYPE_OBJECT:
                $dom = $this->objectToDom($this->source);

                return simplexml_import_dom($dom);
            case self::SOURCE_TYPE_FILE:
                return simplexml_load_file($this->source);
            case self::SOURCE_TYPE_STRING:
                return simplexml_load_string($this->source);
        }
    }
public function toSimpleXML ( $ applystyles = true ) { if ( $ applystyles && ! empty ( $ this -> styles ) ) { $ dom = $ this -> toDOM ( $ applystyles ) ; return simplexml_import_dom ( $ dom ) ; } switch ( $ this -> sourceType ) { case self :: SOURCE_TYPE_DOM : return simplexml_import_dom ( $ this -> source ) ; case self :: SOURCE_TYPE_SIMPLEXML : return $ this -> source ; case self :: SOURCE_TYPE_OBJECT : $ dom = $ this -> objectToDom ( $ this -> source ) ; return simplexml_import_dom ( $ dom ) ; case self :: SOURCE_TYPE_FILE : return simplexml_load_file ( $ this -> source ) ; case self :: SOURCE_TYPE_STRING : return simplexml_load_string ( $ this -> source ) ; } }
Converts source to SimpleXMLElement.

@param bool $applystyles Apply stylesheets yes/no. Default is true.

@return SimpleXMLElement

@todo support for passing XsltProcessor as parameter
@todo check simplexml_load_file() return value for false
@todo simplexml_check load_string() return value for false
Converts source to SimpleXMLElement .