Added XML validation tests and fixed issues with outputted XML 1.4.x com...

...patibility