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