title: find xml files that contain milti line pattern
body: <p>I am trying to search a large number of xml files for files that are missing a specific tag, or where the value inside that tag is 0.</p>
  
  <p>Basically, each xml file has one or more LIBRARY tags, and nested inside those is one or more SECTION tags, and inside those is one or more SHELF tags. Inside the SHELF tags there <em>should</em> be a BOOK tag with an integer value that is not zero.</p>
  
  <p>I need to find the files where this BOOK value is 0 or where the BOOK is missing, but <strong>only</strong> in the <strong>first</strong> SHELF of each SECTION. So if there are multiple SECTION tags nested inside multiple LIBRARY tags, I need to check the first SHELF in each and every SECTION.</p>
  
  <pre><code>&lt;LIBRARY&gt;
      &lt;SECTION&gt;
          &lt;SHELF&gt;
              &lt;BOOK&gt;10000&lt;/BOOK&gt;
          &lt;/SHELF&gt;
      &lt;/SECTION&gt;
  &lt;/LIBRARY&gt;
  </code></pre>
  
  <p>I am trying to write a Unix script to achieve this by searching each file in a given directory and returning a list of the files that match the pattern. I have been searching for a way to do it with sed, but I can't seem to find the solution to this particular problem. Also, the xml files are multi-line files, as shown above. Thank you guys for any help you can provide!</p>