ToString
should most definately work. I use it all the time. What does it return for you in this case? An empty string? My guess is that something went wrong building your XElement
. To debug, rewrite the code to add each of the child XElement
s separately, so that you can step through your code and check on each of them. Then before you execute the .ToString
, in the Locals window, look at the [xml]
variable expanded to xml.
In short, your problem is happening before you ever get to the ToString()
method.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…