XQuery for every node except for something

i want to query for all nodes except for a selected few.  this is pretty
straight forward in SQL, but how do you do it for XQuery?  I can do this
in XSLT but want an equivalent XQuery.

for example:

<Directories>
<Permission>
  <Mask>744</Mask>
</Permission>
<File>
  <Name>.cshrc</Name>
  <Owner>mluu</Owner>
</File>
<Directory>
  <Name>D1</Name>
  <Owner>mluu</Owner>   
  <File>
    <Name>README.txt</Name>
    <Owner>mluu</Owner>
  </File>
  <File>
    <Name>foo.txt</Name>
    <Owner>cchan</Owner>
  </File>
  <File>
    <Name>bar.txt</Name>
    <Owner>cchan</Owner>
  </File>
  <Directory>
    <Name>D2</Name>
    <Owner>mluu</Owner>   
  </Directory>
  <Directory>
    <Name>D3</Name>
    <Owner>cchan</Owner>   
  </Directory>
</Directory>
</Directories>

i want to return all the nodes that do not contain an <Owner> element or
if a node where its child <Owner> element is equal to "mluu".   so the
resulting output would be:

<Directories>
<Permission>
  <Mask>744</Mask>
</Permission>
<File>
  <Name>.cshrc</Name>
  <Owner>mluu</Owner>
</File>
<Directory>
  <Name>D1</Name>
  <Owner>mluu</Owner>   
  <File>
    <Name>README.txt</Name>
    <Owner>mluu</Owner>
  </File>
  <Directory>
    <Name>D2</Name>
    <Owner>mluu</Owner>   
  </Directory>
 </Directory>
</Directories>

thanks for your help!

-mike

Received on Friday, 19 December 2003 19:49:17 UTC