title: Get the value of an element, but only when the element above it has a specific value
body: <p>First time posting on Stack Overflow.</p>
  <p>I am struggling with handling a specific XML structure in C#</p>
  <p>The below XML represents columns and their respective values in a table. Naturally you can have multiple rows.</p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-16&quot;?&gt;
  &lt;DataTable Uid=&quot;BOY_2&quot;&gt;
      &lt;Columns&gt;
          &lt;Column Uid=&quot;Col1&quot; Type=&quot;1&quot; MaxLength=&quot;1&quot;/&gt;
          &lt;Column Uid=&quot;DocEntry&quot; Type=&quot;2&quot; MaxLength=&quot;0&quot;/&gt;
          &lt;Column Uid=&quot;DocNum&quot; Type=&quot;2&quot; MaxLength=&quot;0&quot;/&gt;
          &lt;Column Uid=&quot;Doctotal&quot; Type=&quot;11&quot; MaxLength=&quot;0&quot;/&gt;
      &lt;/Columns&gt;
      &lt;Rows&gt;
          &lt;Row&gt;
              &lt;Cells&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;Col1&lt;/ColumnUid&gt;
                      &lt;Value&gt;Y&lt;/Value&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;DocEntry&lt;/ColumnUid&gt;
                      &lt;Value&gt;10&lt;/Value&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;DocNum&lt;/ColumnUid&gt;
                      &lt;Value&gt;365&lt;/Value&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;Doctotal&lt;/ColumnUid&gt;
                      &lt;Value&gt;175.730000&lt;/Value&gt;
                  &lt;/Cell&gt;
              &lt;/Cells&gt;
          &lt;/Row&gt;
          &lt;Row&gt;
              &lt;Cells&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;Col1&lt;/ColumnUid&gt;
                      &lt;Value&gt;Y&lt;/Value&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;DocEntry&lt;/ColumnUid&gt;
                      &lt;Value&gt;12&lt;/Value&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;DocNum&lt;/ColumnUid&gt;
                      &lt;Value&gt;366&lt;/Value&gt;
                  &lt;/Cell&gt;
                  &lt;Cell&gt;
                      &lt;ColumnUid&gt;Doctotal&lt;/ColumnUid&gt;
                      &lt;Value&gt;173.970000&lt;/Value&gt;
                  &lt;/Cell&gt;
              &lt;/Cells&gt;
          &lt;/Row&gt;
      &lt;/Rows&gt;
  &lt;/DataTable&gt;
  </code></pre>
  <p>I am trying to get it so that if the element under cell called ColumnUid = Col1, to add the value in the element below called value to a list.</p>
  <p>So in my example I just want to get the value 'Y' from both rows in the XML.</p>
  <p>I can't for the life of me figure out how to get this to work. Please help!</p>
  <p>Please excuse my poor wording of this, I am new to programming and dealing with XML.</p>