Returns the indented XML for this node. : Nodes « XML LINQ « C# / C Sharp






Returns the indented XML for this node.

  
using System;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass{
   public static void Main(){

        XElement xmlTree = new XElement("Root",
            new XElement("A1", 1)
        );
        Console.WriteLine(xmlTree);
   }
}

   
    
  








Related examples in the same category

1.Calling the Only Nodes Prototype
2.Traversing Backward from an XElement Object via the PreviousNode Property
3.Adds the specified content immediately after this node.
4.Adds the specified content immediately before this node.
5.Returns a collection of the ancestor elements of this node.
6.Returns a filtered collection of the ancestor elements of this node.
7.Creates an XmlReader for this node.
8.Use hard coded xsl to convert xml document
9.Returns a collection of the sibling elements after this node, in document order.
10.Returns a filtered collection of the sibling elements after this node, in document order.
11.Returns a collection of the sibling elements before this node, in document order.
12.Returns a filtered collection of the sibling elements before this node, in document order.
13.Determines if the current node appears after a specified node in terms of document order.
14.Determines if the current node appears before a specified node in terms of document order.
15.Gets the next sibling node of this node.
16.Returns a collection of the sibling nodes after this node, in document order.
17.Returns a collection of the sibling nodes before this node, in document order.
18.Gets the previous sibling node of this node.
19.Removes this node from its parent.
20.Replaces this node with the specified content.
21.Returns the XML for this node, optionally disabling formatting.
22.Writes this node to an XmlWriter.