2

I am unable to find something like XDocumentFragment. Is there an equivalent of XmlDocumentFragment in LINQ to XML?

I know that I can keep nodes in a collection. But how to conveniently serialize a bunch of various nodes to string, like this:

new XDocumentFragment(myNodes).ToString()
TN.
  • 18,874
  • 30
  • 99
  • 157
  • Could you give an example of what you're trying to achieve? Pretend that `XDocumentFragment` *did* exist, and show us how you'd use it. – Jon Skeet Jul 11 '14 at 12:39

1 Answers1

2

You can simply concatenate string representation of nodes:

var xml = String.Concat(myNodes);
Sergey Berezovskiy
  • 232,247
  • 41
  • 429
  • 459