Added char control check and debug messages

Added char control check for Text parsing
Added debug messages for incorrect XML format.