diff --git a/src/LocalizedStringElementTrait.php b/src/LocalizedStringElementTrait.php index 6fa8613..e54877d 100644 --- a/src/LocalizedStringElementTrait.php +++ b/src/LocalizedStringElementTrait.php @@ -93,7 +93,7 @@ public static function fromXML(DOMElement $xml): static final public function toXML(DOMElement $parent = null): DOMElement { $e = $this->instantiateParentElement($parent); - $e->setAttributeNS(C::NS_XML, 'xml:lang', $this->language); + $e->setAttributeNS(C::NS_XML, 'xml:lang', $this->getLanguage()); $e->textContent = $this->getContent(); return $e;