diff --git a/src/ArrayToXml.php b/src/ArrayToXml.php index 3c016a4..7853eef 100644 --- a/src/ArrayToXml.php +++ b/src/ArrayToXml.php @@ -90,11 +90,11 @@ public static function convert( return $converter->toXml(); } - public function toXml(): string + public function toXml($options = 0): string { return $this->addXmlDeclaration - ? $this->document->saveXML() - : $this->document->saveXML($this->document->documentElement); + ? $this->document->saveXML(options: $options) + : $this->document->saveXML($this->document->documentElement, $options); } public function toDom(): DOMDocument