[fix bug 703408] Validate XML data.

I'm validating each `data` key separately. This way we can display more meaningful messages to the user, pointing to the value which causes the error.