Add checking before operate a XML attribute which could be None.

For fixing the bug TTS-812 (NoneType exception is raised when try to operate a null XML attribute "notes.text"), Add checking before operate this attribute.