How to represent space and tab in XML tag. Is there any special characters for them to represent.
If you are talking about the issue where multiple and non-space whitespace characters are stripped specifically from attribute values, then yes, encoding them as character references such as 	 will fix it.
Illegal XML Tag Name Characters can be encoded using Unicode UCS-2. This works very nicely. I am using it to create XML that gets turned into json (JPath is weak compared to XPath). Notice the handling of spaces, (, ) characters. Unicode UCS-2 Code Chart: http://www.columbia.edu/kermit/ucs2.html
tag.Name = tag.Name.Replace(" ", "_x0020_");
tag.Name = tag.Name.Replace("(", "_x0028_");
tag.Name = tag.Name.Replace(")", "_x0029_");
XML:
<Internal_x0020_Chargeback_x0020_ID>{CHARGEBACKCODE}</Internal_x0020_Chargeback_x0020_ID>
<Bill_x0020_To>{CHARGEBACKCODE}</Bill_x0020_To>
<Operator_x0020_or_x0020_Directly_x0020_Responsible_x0020_Individual_x0020__x0028_DRI_x0029_>zzz@yyy.gov</Operator_x0020_or_x0020_Directly_x0020_Responsible_x0020_Individual_x0020__x0028_DRI_x0029_>
transformed to json via json.net:
"Internal Chargeback ID": "{CHARGEBACKCODE}",
"Bill To": "{CHARGEBACKCODE}",
"Operator or Directly Responsible Individual (DRI)": "xxx@yyy.gov",