LOCAL lcXML AS String, loXML as MSXML2.DomDocument TEXT TO lcXML TEXTMERGE NOSHOW PRETEXT 3 <?xml version="1.0"?> <!DOCTYPE foo [ <!ELEMENT foo (#PCDATA)> ]> <!-- More DTD stuff goes here --> <!-- Add XML nodes here... --> ENDTEXT ** ...Or here lcXML = lcXML + "<foo>bar</foo>" loXML = CREATEOBJECT("MSXML.DomDocument") loXML.validateOnParse = .F. IF loXML.loadXML(lcXML) ** ...Or here ELSE MESSAGEBOX(loXML.parseError.reason) ENDIFAlso, I would strongly suggest that you switch to XML schemas instead: it's XML(!), it supports more data types, and you can validate more complex structures.