Clears all previously written elements so that the document starts fresh.

@return  \stubbles\xml\XmlStreamWriter
508399
public function clear(): XmlStreamWriter
    {
        $this->doc          = new \DOMDocument($this->version(), $this->encoding());
        $this->openElements = [$this->doc];
        return parent::clear();
    }
58541
public function clear()
    {
        $directory = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($this->path),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        $cacheIterator = new \RegexIterator($directory, '/^.+\.cache/i', \RecursiveRegexIterator::GET_MATCH);

        $isCleared = false;

        foreach ($cacheIterator as $cacheFiles) {
            foreach ($cacheFiles as $cacheFile) {
                if (false === ($isCleared = unlink($cacheFile))) {
                    return $isCleared;
                    break;
                }
            }
        }

        return $isCleared;
    }
655645
public function writeXmlFragment(string $fragment): XmlStreamWriter
    {
        return $this->append(
                function(\DOMNode $parent) use ($fragment)
                {
                    $fragmentNode = $this->doc->createDocumentFragment();
                    $fragmentNode->appendXML($fragment);
                    @$parent->appendChild($fragmentNode);
                },
                'document fragment'
        );
    }
1010500
public function clear() {
		$keys = array_merge(
			$this->get_table_keys(),
			$this->get_wp_object_keys()
		);

		foreach ( $keys as $key ) {
			try {
				$this->set_attribute( $key, null );
			} catch ( Exception $e ) {
				// We won't clear out guarded attributes.
				if ( ! ( $e instanceof GuardedPropertyException ) ) {
					throw $e;
				}
			}
		}

		return $this;
	}
869884
public function putXML(){
		$xml = $this->getXML();
		return $this->distributor->write($xml, $this->proper_path);
	}
1011817
public function clearDocument()
    {
        $this->version = '1.0';
        $this->href = null;
        $this->scope = null;
        $this->attributes = new \StdClass();
        $this->links = new \StdClass();
        $this->items = [];
        $this->errors = null;
        return $this;
    }
917133
public function toXML()
    {
        $namespace = 'tns';
        $writer = new XMLWriter();
        $writer->openMemory();
        $writer->setIndent(true);
        $writer->setIndentString('    ');
        $writer->startElementNs($namespace, 'Porez', null);
        if ($this->getName()) {
            $writer->writeElementNs($namespace, 'Naziv', null, $this->getName());
        }
        $writer->writeElementNs($namespace, 'Stopa', null, $this->getRate());
        $writer->writeElementNs($namespace, 'Osnovica', null, $this->getBaseValue());
        $writer->writeElementNs($namespace, 'Iznos', null, $this->getValue());
        $writer->endElement();

        return $writer->outputMemory();
    }
784566
public function toXML(){

            $oXMLout = new \XMLWriter();
            $oXMLout->openMemory();
            $oXMLout->setIndent(true);
            $oXMLout->setIndentString('    ');


        $oXMLout->startDocument("1.0", 'utf-8');
        $oXMLout->startElement('tasks');

        /**
         * @var \Dlin\Saasu\Task\Task $task
         */
        foreach($this->tasks as $task){
           $oXMLout->writeRaw("\n".$task->toXML());
        }
        $oXMLout->endElement();
        $oXMLout->endDocument();

        $xml = $oXMLout->outputMemory();

        return $xml;
    }
729556
protected function createJUnitXMLWriter()
    {
        $streamWriter = $this->createStreamWriter($this->junitXMLFile);
        $utf8Converter = extension_loaded('mbstring') ? new UTF8Converter() : new NullUTF8Converter();

        return $this->junitXMLRealtime ? new StreamJUnitXMLWriter($streamWriter, $utf8Converter) : new DOMJUnitXMLWriter($streamWriter, $utf8Converter);
    }
1271595
public function writeEndElement(): self
    {
        if ($this->isFinished()) {
            throw new \LogicException('Can not write end elements, no element open.');
        }

        $this->doWriteEndElement();
        $this->depth--;
        return $this;
    }
973923
public function clearFile()
    {
        $cleared = false;

        if (isset($this->file_pointer)) {
            $cleared = $this->file_pointer->ftruncate(0);
        }

        return $cleared;
    }
1180899
public function clearItems() {
		foreach ( $this->items as $item ) {
			$item->setElementGroup( null );
		}

		$this->items = [];
		$this->group->clearContent();

		return $this;
	}
814275
public function clear()
    {
        $cleared = false;
        try {
            /* @todo Not at all sure about this... do we really want to flush()? What happens if the storage supports
            /*       namespaces, but none has been provided? */
            $options = $this->storage->getOptions();
            $namespace = $options->getNamespace();
            if ($this->storage instanceof ClearByNamespaceInterface && $namespace) {
                $cleared = $this->storage->clearByNamespace($namespace);
            } elseif ($this->storage instanceof FlushableInterface) {
                $cleared = $this->storage->flush();
            } else {
                throw new CacheException(sprintf("Storage %s does not support clear()", get_class($this->storage)));
            }
        } catch (Exception\InvalidArgumentException $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);

        } catch (Exception\ExceptionInterface $e) {
            throw new CacheException($e->getMessage(), $e->getCode(), $e);
        }

        return $cleared;
    }
202791
private function createRawXmlDocument()
    {
        $xmlDocument = new \DOMDocument;
        $xmlDocument->encoding = 'UTF-8';
        $xmlDocument->strictErrorChecking = false;
        $xmlDocument->formatOutput = true;
        $libXmlState = libxml_use_internal_errors(true);
        $xmlDocument->loadHTML($this->getUnifiedHtml());
        libxml_clear_errors();
        libxml_use_internal_errors($libXmlState);
        $xmlDocument->normalizeDocument();

        return $xmlDocument;
    }
1196763
public function clear()
    {
        $this->elements = array();
        foreach ($this->subLists as $subList) {
            $subList->clear(true);
        }
        return $this;
    }
277952
public function clear()
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        session_destroy();
        $this->is_opened = false;
        return $this;
    }
1137724
public function formatted()
    {
        $doc = dom_import_simplexml($this->root)->ownerDocument;
        $doc->preserveWhiteSpace = false;
        $doc->formatOutput = true;
        $doc->encoding = 'UTF-8';

        return $doc->saveXML();
    }