Not include ProcessingInstruction, please

I am using the Delphi code below to save my IXMLDOMDocument2 to a file, I am using this because it makes it human readable.

However, I do not require the ProcessingInstruction. I am not creating one in the document so I'm thinking this code is somehow putting it in there. Any thoughts??

procedure SaveXML(AXML: IXMLDOMDocument2; APath: String);
  wrt: MXXMLWriter40;
  sax: SAXXMLReader40;
  memoutput: TMemoryStream;
  wrt := CoMXXMLWriter40.Create;
  sax := CoSAXXMLReader40.Create;
  sax.contentHandler := (wrt as IVBSAXContentHandler) ;
  sax.dtdHandler := (wrt as IVBSAXDTDHandler);
  sax.errorHandler := (wrt as IVBSAXErrorHandler);
  sax.putProperty('', wrt);
  sax.putProperty('', wrt);
    wrt.indent := True;
    wrt.disableOutputEscaping := True;
    wrt.omitXMLDeclaration := False;
    memoutput := TMemoryStream.Create;
      wrt.output := TStreamAdapter.Create(memoutput) as IStream;
      memoutput.Position := 0;
    wrt := nil;
    sax := nil;
LVL 27
Eddie ShipmanAll-around developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Eddie ShipmanAll-around developerAuthor Commented:
BTW, using the IXMLDOMDocument save method DOES NOT place the PI in the document but it is not
Yes, I have tried the preserveWhiteSpace property, with no effect.
Gertone (Geert Bormans)Information ArchitectCommented:
have you tried
   wrt.omitXMLDeclaration := True;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eddie ShipmanAll-around developerAuthor Commented:
I thought Itried that, too, we'll see..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.