title: Parse XML file for attribute from batch file
body: <p>I am parsing a XML file like below:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!--
  --&gt;
  &lt;configuration&gt;
     &lt;settings&gt;
        &lt;connections&gt;
              &lt;connection name="name1" value="connection1" type="abc"/&gt;
              &lt;connection name="name2" value="connection2" type="def"/&gt;
        &lt;/connections&gt;
     &lt;/settings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>From the batch file, I prompt the user for connection name. I want to parse the XML get a connection with the specified name and get its value. So If user gives name1, I want to select connection1. I had the below code from <a href="https://stackoverflow.com/questions/13902744/extract-xml-tag-values-based-on-a-flag-using-batch">Extract XML Tag Values (Based on a Flag) Using Batch</a></p>
  
  <p>I am not familiar with for loop in (especially delimits, tokens) batch file, so I am not sure how this works and how to make it work for me.</p>
  
  <pre><code>(for /F "tokens=1,2 delims== " %%a in (connection.config) do (
     if "%%~b" neq "" set %%a=%%~b
     if /I "!name!" equ "%name%" echo !value!
  ))
  </code></pre>