I have an XML file, I have a node and I read all ChildNodes. The name of the childNode match to a variable I have to set with the value of this childNode.
In the loo
If you are seeking to assign variables based on the names of nodes in XML, you have at least a couple options:
All of these approaches suggest a more object-oriented approach to the problem then just populating a few variables, but it would be easy to create a lightweight structure with the appropriate members which is populated by reading the XML document.
You could also use a key-based collection (like a Dictionary) to store the values if you are just looking to build a simple name/value collection from the source XML.