title: How to read properties from xml file with java?
body: <p>I have the following xml file:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;resource id="res001"&gt;
          &lt;property name="propA" value="A" /&gt;
          &lt;property name="propB" value="B" /&gt;
      &lt;/resource&gt;
      &lt;resource id="res002"&gt;
          &lt;property name="propC" value="C" /&gt;
          &lt;property name="propD" value="D" /&gt;
      &lt;/resource&gt;
      &lt;resource id="res003"&gt;
          &lt;property name="propE" value="E" /&gt;
          &lt;property name="propF" value="F" /&gt;
      &lt;/resource&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>How can I do something like this with Java/Xml:</p>
  
  <pre><code>Xml xml = new Xml("my.xml");
  Resource res001 = xml.getResouceById("res003");
  System.out.println("propF: " + res.getProperty("propF"));
  </code></pre>
  
  <p>So it prints:</p>
  
  <pre><code>F
  </code></pre>
  
  <p>I have tried apache commons-configurations XMLConfiguration with XPathExpressionEngine, but I just can't make it work. I have googled and found some examples, but neither would work :(
  I'm looking for a solution where I don't need to loop through all the elements.</p>
  
  <p>Regards,
  Alex</p>