title: How do you use the --pattern option of xmllint?
body: <p>I'm trying to see how libxml implements XPath support, so it made sense to me to test using xmllint. However, the obvious option, --pattern, is somewhat obscure, and I ended up using something like the following:</p>
  
  <pre><code>test.xml: &lt;foo&gt;&lt;bar/&gt;&lt;bar/&gt;&lt;/foo&gt;
  
  &gt; xmllint --shell test.xml
  /  &gt; dir /foo
  ELEMENT foo
  /  &gt; dir /foo/*
  ELEMENT bar
  ELEMENT bar
  </code></pre>
  
  <p>This seems to work, and that's great, but I'm still curious. <strong>What is xmllint's --pattern option for, and how does it work?</strong></p>
  
  <p>Provide an example for full credit. =)</p>