Names and values in attributes should only contain valid XML attribute characters. XML attribute names must be unique. Use SecurityElement.Escape(string) to remove invalid characters from the string.
There is no support for quoted strings, so strings for name/value pairs should not contain quotes or other characters requiring quoting.