The corresponding paragraphs of the links themselves and do not contain:
It is often convenient to use "white space" (for spaces, tabs, and lines) for greater readability. Such white space is the version of the document. There is no need for a prefix.
An XML processor must be passed through to the application.
I translate:
When editing XML documents, it is often convenient to use "whitespace" (spaces, tabs, blank lines) to separate markup in order to improve readability. These "whitespace" characters are usually not intended to be included in the supplied version of the document. On the other hand, there are often significant white space characters that need to be saved, for example, in verses or program code.
All whitespace characters that are not directly related to the markup must be passed to the application in the data that is parsed by the XML processor.
(However, there are details on the normalization of non-standard string conversions to single \n / #xA / 10 , thanks to @ ru-volt )
The markup in this case are only the tags, delimited by angle brackets, therefore, in the text, everything that is between the end of the opening tag > and the beginning of the closing < , including whitespace characters, should be saved.
Actually, libxml (pulled from Ruby through Nokogori) does just that:
require 'nokogiri' Nokogiri::XML(<<XML).first_element_child.text <text> Какой-то текст в две строки </text> XML
"\nКакой-то текст\nв две строки\n"
Here, Ruby shows lines with escaping, \n is a "newline character", and double quotes are part of the view, not part of the data. The technology you use can display such strings differently.