Examples xml.DomDocument usage examples. Example 1 : Create a namespace qualified document with processing instructionsExample 2 : Validating a document against XML schemas or a DTD