> Hex 0x10 isn't a line feed (\n); *decimal* 10 (0xA) is.
That's correct.
> All whitespace (including \n) gets normalized to spaces.
*Not* correct, when you're working with the APIs. If you feed an XML-legal
character into the DOM or SAX, it should be converted to numeric character
reference automatically by the serializer when you write it out as XML --
just as the parser converts the numeric character reference into that
character when you read it back in (modulo attribute-value-normalization
rules).
>>test.appendChild(doc.createTextNode("\u0010"));
>Replace "\u0010" with "
".
Also not correct. If you do so, the serializer will escape the & character;
you'll wind up with the text string "&xa;" or equivalent.
You really should be able to use \n, or \u000A, and have the Right Thing
happen. If it doesn't, something is broken -- either the serializer isn't
writing the data out correctly, or whoever's downstream isn't reading it
back in correctly.
But you do have to distinguish decimal from hex!