i want to add the version and encodig to a xml file created with TXMLDocument component
<?xml version="1.0" encoding="utf-8"?>
curently i'm doing this
XmlDoc :=TXMLDocument.Create(nil);
XmlDoc.Version:='1.0';
XMLDoc.Encoding:='utf-8';
but i receive an acces violation in this line
XmlDoc.Version:='1.0';
how i can add the version and encoding?