1. A method to query a compound XML document, the method comprising: receiving a compound XML document comprising a primary document and a first nested document; determining an encoding type associated with the first nested document; generating a single query against the compound document, the query comprising an attribute and the encoding type of the first nested document; executing the query and receiving a rowset from the first nested document.