Whitespace is one of the few non-markup characters to which XML pays special attention. In a nutshell, the XML specification dictates that whitespace in content should be preserved and passed unmodified to applications, while whitespace within markup or attributes can be removed. In XML documents, whitespace is typically used to distinguish elements and enhance readability.
So what is whitespace? XML whitespace consists of these four characters:
- ASCII space: hex 20
- Tab: hex 09
- Carriage Return: hex 0D
- Line Feed: hex 0A