// Path: src/main/java/xdb/control/Query.java
// public interface Query {
// 
//     /**
//      * Execute the query.
//      * 
//      * @param doc
//      *            The document being queried.
//      * @param params
//      *            Query parameters.
//      * @return The list of nodes in the results.
//      * @throws xdb.control.QueryException
//      *             For errors.
//      */
//     public List<Node> query(Document doc, Map<String, String[]> params) throws QueryException;
// }
// 
// Path: src/main/java/xdb/control/QueryException.java
// @SuppressWarnings("serial")
// public class QueryException extends Exception {
// 
//     /**
//      * Constructor.
//      * 
//      * @param message
//      *            The error message.
//      * @param rootCause
//      *            The true cause of the exception.
//      */
//     public QueryException(String message, Exception rootCause) {
//         super(message, rootCause);
//     }
// }


import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import xdb.control.Query;
import xdb.control.QueryException;
package xdb.query;



/**
 * A "query" that simply returns the entire document. For global XML processing such as XQuery.
 * 
 * @author ps142237
 */
public class WholeDocQuery implements Query {

    /**
     * Init the query from its configuration.
     * 
     * @param configElement
     *            The configuration element.
     * @return The query.
     */
    public static WholeDocQuery init(Element configElement) {
        return new WholeDocQuery();
    }

    /** Constructor. */
    public WholeDocQuery() {
    }

    @Override
// Path: src/main/java/xdb/control/Query.java
// public interface Query {
// 
//     /**
//      * Execute the query.
//      * 
//      * @param doc
//      *            The document being queried.
//      * @param params
//      *            Query parameters.
//      * @return The list of nodes in the results.
//      * @throws xdb.control.QueryException
//      *             For errors.
//      */
//     public List<Node> query(Document doc, Map<String, String[]> params) throws QueryException;
// }
// 
// Path: src/main/java/xdb/control/QueryException.java
// @SuppressWarnings("serial")
// public class QueryException extends Exception {
// 
//     /**
//      * Constructor.
//      * 
//      * @param message
//      *            The error message.
//      * @param rootCause
//      *            The true cause of the exception.
//      */
//     public QueryException(String message, Exception rootCause) {
//         super(message, rootCause);
//     }
// }


// Path: src/main/java/xdb/query/WholeDocQuery.java
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import xdb.control.Query;
import xdb.control.QueryException;

package xdb.query;



/**
 * A "query" that simply returns the entire document. For global XML processing such as XQuery.
 * 
 * @author ps142237
 */
public class WholeDocQuery implements Query {

    /**
     * Init the query from its configuration.
     * 
     * @param configElement
     *            The configuration element.
     * @return The query.
     */
    public static WholeDocQuery init(Element configElement) {
        return new WholeDocQuery();
    }

    /** Constructor. */
    public WholeDocQuery() {
    }

    @Override
    public List<Node> query(Document doc, Map<String, String[]> params) throws QueryException {