Check for XMLWriter class

Backport of https://github.com/owncloud/core/pull/12321