title: Is there an XPath to find nodes beneath a certain pattern?
body: <p>I'm trying to write an xpath to find xml nodes with descendants that follow a specific pattern. For example, if I have the following xml:</p>
  
  <pre><code>&lt;While&gt;
    &lt;Condition&gt;
      &lt;ID val="shouldLoop"/&gt;
    &lt;/Condition&gt;
    &lt;Assign&gt;
      &lt;ID val="StringVariable1"/&gt;
      &lt;Parens&gt;
        &lt;Parens&gt;
          &lt;String val="StringLiteral"/&gt;
        &lt;/Parens&gt;
      &lt;/Parens&gt;
    &lt;/Assign&gt;
    &lt;Assign&gt;
      &lt;ID val="StringVariable2"/&gt;
      &lt;String val="StringFigurative"/&gt;
    &lt;/Assign&gt;
    &lt;Assign&gt;
      &lt;ID val="StringVariable3"/&gt;
      &lt;Add&gt;
        &lt;String val="StringLiteral"/&gt;
        &lt;String val="StringFigurative"/&gt;
      &lt;/Add&gt;
    &lt;/Assign&gt;
  &lt;/While&gt;
  </code></pre>
  
  <p>I would like to get the first two of the three "Assign" nodes, based on them having a child node that's a "String" node nested within 0 or more "Parens" tags.  </p>
  
  <p>Is there an xpath that'll accomplish this similarly to how with regular expressions something like "(Parens/)*String" would match both "String" and "Parens/Parens/String"?</p>