Assuming it has not changed and I've missed it, this old information should still be applicable.
Look at the last post as Mark explains the error you got and what needs to be done to make the XML schema aware before validating it.
Thanks a lot
A call to
createSchemaBasedXML()seems all it was needed