To remove CA2202 warning

CA2202 Do not dispose objects multiple times
Object 'sw' can be disposed more than once in method
'XAttribute.ToString()'.
To avoid generating a System.ObjectDisposedException you should not call
Dispose more than one time on an object.