XML  •  Store Book Data

Listing 1. The books.xml document contains several book titles along with their publication dates, authors, and publishers. You can execute an XQuery statement against this data to select titles based on criteria such as publisher and/or publication date.

<?xml version="1.0" encoding="utf-8" ?>
<books>
   <book year="2000">
      <title>Data on the Web</title>
      <author><last>Abiteboul</last><first>Serge
         </first></author>
      <author><last>Buneman</last><first>Peter
         </first></author>
      <author><last>Suciu</last><first>Dan
         </first></author>
      <publisher>Morgan Kaufmann 
         Publishers</publisher>
      <price>39.95</price>
   </book> 
   <book year="2001">
      <title>XML for ASP.NET Developers</title>
      <author><last>Wahlin</last><first>Dan
         </first></author>
      <publisher>Sams Publishing</publisher>
      <price>39.99</price>      
      </book>      
   <book year="2001">
      <title>ASP.NET: Tips, Tutorials, and 
         Code</title>
      <author><last>Mitchell</last><first>Scott
         </first></author>
      <author><last>Mack</last><first>Donny
         </first></author>
      <author><last>Walther</last><first>Stephen
         </first></author>
      <author><last>Seven</last><first>Doug</first></author>
      <author><last>Anders</last><first>Bill
         </first></author>
      <author><last>Nathan</last><first>Adam
         </first></author>
      <author><last>Payne</last><first>Chris
         </first></author>
      <author><last>Wahlin</last><first>Dan
         </first></author>
      <publisher>Sams Publishing</publisher>
      <price>49.95</price>   
   </book>
</books>