# Reading Child nodes from XML file -- C#

**URL:** <https://forum.kirupa.com/t/reading-child-nodes-from-xml-file-c/255337>\
**Category:** programming\
**Created:** [March 21, 2008, 11:17am UTC](https://forum.kirupa.com/t/reading-child-nodes-from-xml-file-c/255337 "2008-03-21T11:17:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![doggy1982](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@doggy1982](https://forum.kirupa.com/u/doggy1982)\
**Post date:** [March 21, 2008, 11:17am UTC](https://forum.kirupa.com/t/reading-child-nodes-from-xml-file-c/255337/1 "2008-03-21T11:17:13Z")

</div>

Hi Friends,.

I am trying to read a XML file and it looks like this…

\<book\>  
\<journal id=“a”\>  
\<english\>fgsfdf\</english\>  
\<french\>sdsdfd\</french\>  
\<chinese\>dfsdd\</chinese\>  
\</journal\>  
\<journal id=“b”\>  
\<english\>ggggf\</english\>  
\<french\>jjjfd\</french\>  
\<chinese\>lllfsdd\</chinese\>  
\</journal\>  
\</books\>

I am trying to read the child nodes under “journal id=2”. Is there way to do it?..

[SIZE=2][COLOR=#008080]XmlDocument[/COLOR][/SIZE][SIZE=2] path = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]XmlDocument[/COLOR][/SIZE]SIZE=2;  
[/SIZE][SIZE=2][COLOR=#008080]XmlNodeList[/COLOR][/SIZE][SIZE=2] abc = path.GetElementsByTagName([/SIZE][SIZE=2][COLOR=#800000]“journal”[/COLOR][/SIZE][SIZE=2]);[/SIZE]  
[SIZE=2][/SIZE]  
[SIZE=2]How to fetch the [journal@id=2](mailto:journal@id=2) elements ?..[/SIZE]  
[SIZE=2][/SIZE]  
[SIZE=2]Thanks.[/SIZE]  
[SIZE=2]  
[/SIZE]
