try UTF-8 for outputStream in generateProfileAsXml()