title: PHP: regular expression to find out and retrieve values from xml attributes
body: <p>How can I write a regular expression to retrieve values from xml node?
  Actually the node structure is very big. So we can't traverse easily, so I want to read as normal text file and hope I can write a regex to find out the matching elements.</p>
  
  <pre><code>&lt;node1&gt;
   &lt;node2&gt;str&lt;/node2&gt;
   &lt;node3&gt;Text&lt;/node3&gt;
   &lt;myvalue&gt;Here is the values string..&lt;/myvalue&gt;
  &lt;/node1&gt;
  </code></pre>
  
  <p>The above is the pattern I want to retrieve values <code>&lt;myvalue&gt;&lt;/myvalue&gt;</code> but in my xml there are so many other node contains the <code>&lt;myvalue&gt;</code> child. So only way to find out the appropriate node which I want is in the above pattern. The only change in  value rest of the node values are same <code>&lt;node2&gt;str&lt;/node2&gt;</code>, <code>&lt;node3&gt;Text&lt;/node3&gt;</code> are always same.</p>
  
  <p>So how can I write the regex for php?</p>