I'm getting an invalid namespace declaration error in some C# code that I'm using inside of an SSIS Script Transformation Component and it has me stumped. The code is as follows:

```
string xml = Row.RejectReason;
XDocument xDoc = XDocument.Parse(xml);
XNamespace tns = "http://sbr.gov.au/comn/event.02.data";

```

When using the above code in SSIS it errors out when trying to parse the XML (possibly because of whitespace), but if I use the same code in a console application it works fine. The only difference being how I declare the value of the xml string:

```
string xml = @"<tns:Event xmlns:tns=""http://sbr.gov.au/comn/event.02.data""><tns:MaximumSeverity.Code>Error</tns:MaximumSeverity.Code><tns:EventItems><tns:EventItem><tns:Error.Code>MAAS.SUBMIT.REQ.UNAUTHORISEDABN</tns:Error.Code><tns:Severity.Code>Error</tns:Severity.Code><tns:Short.Description>Short desc</tns:Short.Description><tns:Detailed.Description>Detailed desc</tns:Detailed.Description><tns:Parameters></tns:Parameters></tns:EventItem></tns:EventItems></tns:Event>";

```

I've checked the XML string it's trying to pass and I can't see any issue or differences as to why it is failing.

Any help would be greatly appreciated.