Código do XML
Autor: forleonardo | Publicado: 2011-04-09T06:52:00-07:00

//Cria a variável Doc para receber o arquivo XML
XmlDocument doc = new XmlDocument();//Carrega em DOC o arquivo XML, o caminho pode ser uma url que poderia estar em qualquer site
//ou pode ser o caminho físico da sua área, por exemplo E:\home\SeuLoginFtp\Web\ARQUIVO.xml// doc.Load("http://www.SEUDOMINIO.com.br/ARQUIVO.xml");doc.Load("http://localhost:51000/websabat/xml/arquivo.xml");//Cria uma instância XmlElement na qual atribuímos a raiz do documento
XmlElement Elem = doc.DocumentElement;//Percorre todos os elementos filhos que existem no elemento raizLabel1.Text += 

***********

&nbsp;
for(int i=0;i&lt;Elem.ChildNodes.Count;i++)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Imprime o valor do elemento encontrado dentro do elemento Filho atual&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text += "Todo Linha: " + Elem.ChildNodes.Item(i).InnerText +&nbsp; "&lt;br&gt;";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//Percorre todos os elementos que estiverem dentro do elemento filho atual&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text += "Quantidade de Nós Filhos: " + Elem.ChildNodes.Item(i).ChildNodes.Count + "&lt;br&gt;";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int a = 0; a &lt; Elem.ChildNodes.Item(i).ChildNodes.Count; a++)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //Imprime o valor do elemento encontrado dentro do elemento Filho atual&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text += "Nó Filho " + a + ": " + Elem.ChildNodes.Item(i).ChildNodes.Item(a).InnerText + "&lt;br&gt;";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int j = 0; j &lt; Elem.ChildNodes.Item(i).ChildNodes.Item(a).ChildNodes.Count; j++)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text += "Nó Neto " + j + ": " + Elem.ChildNodes.Item(i).ChildNodes.Item(a).ChildNodes.Item(j).InnerText + "&lt;br&gt;";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }

*******



Label1.Text += "Nota Fiscal Número: " +&nbsp; Elem.ChildNodes.Item(0).ChildNodes.Item(0).InnerText + "&lt;br&gt;";Label1.Text += "Data: " + Elem.ChildNodes.Item(0).ChildNodes.Item(1).InnerText + "&lt;br&gt;";Label1.Text += "Cliente:" + Elem.ChildNodes.Item(0).ChildNodes.Item(2).InnerText + "&lt;br&gt;";


**********



TableRow tr1 = new TableRow();TableCell tc1 = new TableCell();tc1.Text = "Nota Fiscal Número " + Elem.ChildNodes.Item(0).ChildNodes.Item(0).InnerText ;tr1.Controls.Add(tc1);Table2.Rows.Add(tr1);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;TableRow tr2 = new TableRow();&nbsp;TableCell tc2 = new TableCell();&nbsp;tc2.Text = "Data " + Elem.ChildNodes.Item(0).ChildNodes.Item(1).InnerText;&nbsp;tr2.Controls.Add(tc2);&nbsp;Table2.Rows.Add(tr2);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp; TableRow tr3 = new TableRow();&nbsp; TableCell tc3 = new TableCell();&nbsp; tc3.Text = "Cliente " + Elem.ChildNodes.Item(0).ChildNodes.Item(2).InnerText;&nbsp; tr3.Controls.Add(tc3);&nbsp; Table2.Rows.Add(tr3);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
************



for (int k =4; k &lt; 7; k++)
{
TableRow trow = new TableRow();
int limite1 = Elem.ChildNodes.Item(0).ChildNodes.Item(k).ChildNodes.Count;
Label1.Text += limite1+"&lt;br&gt;";
for (int n = 0; n &lt; limite1; n++)
{
TableCell tcell = new TableCell();
tcell.Text = Elem.ChildNodes.Item(0).ChildNodes.Item(k).ChildNodes.Item(n).InnerText;
trow.Controls.Add(tcell);
}
Table1.Rows.Add(trow);
}