All, I want to create a soap envelope xml document eg.
You need to use the XName.Get method to construct the attribute name with a namespace:
XName.Get
var xName = XName.Get("myAttributeName", "http://www.w3.org/2001/XMLSchema-instance"); var attr = new XAttribute(xName, "myAttributeValue");