Introduction to Berkeley DB XML

A guided tour of this native XML database system

Legal Notice

This documentation is distributed under an open source license. You may review the terms of this license at:

Oracle, Berkeley DB, Berkeley DB XML and Sleepycat are trademarks or registered trademarks of Oracle. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Oracle.

Java™ and all Java-based marks are a trademark or registered trademark of Sun Microsystems, Inc, in the United States and other countries.

To obtain a copy of this document's original source code, please submit a request to the Oracle Technology Network forum at:


Table of Contents

1. Overview
Basic Concepts
Running the Shell
Getting Help
2. XQuery and Berkeley DB XML
Adding Data
Queries Involving Document Structure
Value Queries
Introducing Indices
Reshaping the Result
Sorting the Result
Working with Data from Multiple Containers
Working with Data from a Specific Document
Using Metadata
Modifying Documents
Schema Constraints
The Berkeley DB XML API
3. Wrapping Up
XML Features
Database Features
Languages and Platforms
4. Where to Learn More
Berkeley DB XML Resources
XML Resources
XQuery Resources

Berkeley DB XML (BDB XML) is an embedded database specifically designed for the storage and retrieval of XML-formatted documents. Built on the award-winning Berkeley DB, BDB XML supports efficient queries against millions of XML documents using XQuery 1.0. XQuery is a query language designed for the examination and retrieval of portions of XML documents.

This document introduces BDB XML and provides a walk through of some of its features using the BDB XML command line shell. It is a high-level overview of the system that provides a basic understanding of what the system does and how it might be useful to your project. This document is not a detailed tutorial or reference guide, so we will omit technical detail, emphasizing what things can be done with BDB XML To get the most out of this document you should be familiar with the basics of XML and XQuery. This guide is written so that you can follow along using the BDB XML shell to run the examples and become familiar BDB XML's capabilities.