1
I have a code XML
similar to this :
<document>
<elemento>
</elemento>
</document>
and the following code C#: (x
is a Xmldocument)
for (int i = 0; i < x.ChildNodes.Count; i ++)
{
var element = x.ChildNodes[i];
Console.WriteLine("Elemento: " + element.Name);
}
Turns out he only lists the first child of the element, in which case document
and does not list the children of document
. How can I list all elements of the code XML
, including children of children?