The code in the file called XQuerytoC++ shows how to use XQilla with CodeSynthesis XSD to convert XQuery results to C++ objects. See the accompanying article in the April 2010 issue of Linux Magazine/Linux Pro Magazine. I'll retain the same customers.xml, customers.xsd and Makefile, but add -lxqilla to link the main.cxx with XQilla. I used version 2.1.3 of XQilla for these examples. The new version 2.2 of XQilla is meant to be used against Xerces-C++ versions 3.x. As Xerces-C++ is too new to be in many Linux distributions at the time of writing (Fedora 11), I stuck with XQilla version 2.1.x. In the code shown in @L:Listing6, the xquery_string is first set the the exact XQuery that was shown above. The next few blocks are the machinery required to execute the xquery_string with XQilla. An XQQuery object is created with the query string and the language of XQilla::XQUERY and the customers.xml file is bound to the query for execution. XQilla has many different XML document implementations. One that uses an Xerces-C DOM to represent the data, as well as a FastXDM custom model. XQilla prefers the later data model because it was designed in house and can execute queries faster. However, we want to have XQilla generate an Xerces-C DOM for us so we can pass it off to CodeSynthesis XSD. To get an Xerces-C DOM, you have to tell XQilla to use a SequenceBuilder to build the result of the query. The SequenceBuilder is created using the XercesConfiguration factory object. This way, after executing the query we can use SequenceBuilder::getSequence to get the Sequence which is really a collection of Xerces-C DOMDocument objects. With our XercesConfiguration generated SequenceBuilder in place, we can get at the query result as CodeSynthesis XSD C++ objects using the DOMDocument just as we did before.