Xerces c++: How to validate xml in DOMWriter?

Hi everyone.
I would like the DOMWriter to output the XML data
according to a schema.
Does anyone know how to do that?
example:
DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
char* goutputfile = "c:\\test.xml";
XMLFormatTarget *destination;
if (goutputfile)
destination = new LocalFileFormatTarget(goutputfile);
else
destination = new StdOutFormatTarget();
DOMNode *docToWrite = doc;
if ( theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true) )
theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
theSerializer->writeNode(destination,*docToWrite);

Somewhere along the line I would like to set a schema location that the
output has to obey (sequences for example). Plus I might find missing tags
and so on.
How can I add a schema location (preferably a local one).
Cheers,
Jens
[958 byte] By [Senna0815] at [2007-11-19 5:01:32]