title: Joining 2 XPath Queries
body: <p>I'm having a hard time with XPath here.. Given the following XPath queries:</p>
  
  <pre><code>$xpath-&gt;query('//input[@name="' . $field . '"]');
  $xpath-&gt;query('//select[@name="' . $field . '"]');
  </code></pre>
  
  <p>Is is possible to combine them into one single query? I want to get the value of the field, however I don't know if the field with be a input, select, textarea...</p>
  
  <p>The way I'm doing it now is like this:</p>
  
  <pre><code>$input = $xpath-&gt;query('//input[@name="' . $field . '"]');
  
  if (empty($input) === true)
  {
      $select = $xpath-&gt;query('//select[@name="' . $field . '"]');
  
      if (empty($select) === true)
      {
          // ...
      }
  }
  </code></pre>
  
  <p>However it seems to cumbersome, I'm sure there must be a way to merge all the queries into one.</p>