In VB.NET, I can easily insert strings into XML literals with <xml><%= "my string" %></xml>.
<xml><%= "my string" %></xml>
How to insert an instance XElement?
XElement
I know that I can use methods in the XElement, XNode, etc. classes, but I would like to do this in XML literals, if possible.
Looks like I can just do the following:
Function GetSomeMoreXml() As XElement Return <moreXml/> End Function Sub Main() Dim myXml = <myXml> <%= GetSomeMoreXml() %> </myXml> End Sub
This is pretty neat. This allows me to break my XML literals into more manageable pieces.
If you really need to do this, you can always do this:
<xml><%= myXElement.ToString() %></xml>
, . , ? XElement, , ( , ).