Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Constants.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Constants.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Constants.java	(revision 6830)
@@ -18,4 +18,12 @@
     public static final String FCS_DIAGNOSTIC_REQUESTED_DATA_VIEW_INVALID =
             FCS_DIAGNOSTIC_URI_PREFIX + 4;
+    public static final String FCS_DIAGNOSTIC_GENERAL_QUERY_SYNTAX_ERROR =
+            FCS_DIAGNOSTIC_URI_PREFIX + 10;
+    public static final String FCS_DIAGNOSTIC_GENERAL_QUERY_TOO_COMPLEX_CANNOT_PERFORM_QUERY =
+            FCS_DIAGNOSTIC_URI_PREFIX + 11;
+    public static final String FCS_DIAGNOSTIC_QUERY_WAS_REWRITTEN =
+            FCS_DIAGNOSTIC_URI_PREFIX + 12;
+    public static final String FCS_DIAGNOSTIC_GENERAL_PROCESSING_HINT =
+            FCS_DIAGNOSTIC_URI_PREFIX + 13;
 
 
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/EndpointDescription.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/EndpointDescription.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/EndpointDescription.java	(revision 6830)
@@ -60,4 +60,16 @@
 
     /**
+     * Get the list of layers that are supported in Advanced Search by this
+     * endpoint.
+     * <p>
+     * The implementation of this method <em>must</em> be thread-safe.
+     * </p>
+     * 
+     * @return the list of layers supported in Advanced Search by this endpoint
+     */
+    public List<Layer> getSupportedLayers();
+
+
+    /**
      * Get a list of all resources sub-ordinate to a resource identified by a
      * given persistent identifier.
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Layer.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Layer.java	(revision 6830)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Layer.java	(revision 6830)
@@ -0,0 +1,183 @@
+package eu.clarin.sru.server.fcs;
+
+import java.net.URI;
+
+/**
+ * This class is used to information about a Layers that is available by the
+ * Endpoint.
+ */
+public class Layer {
+    /**
+     * The content encoding policy for a Layer
+     */
+    public enum ContentEncoding {
+        /**
+         * Value information is encoded as element content in this layer.
+         */
+        VALUE,
+        /**
+         * No additional value information is encoded for this layer.
+         */
+        EMPTY
+    }
+    private final String id;
+    private final URI resultId;
+    private final String type;
+    private final ContentEncoding encoding;
+    private final String qualifier;
+    private final String altValueInfo;
+    private final String altValueInfoURI;
+
+
+    /**
+     * Constructor.
+     *
+     * @param id
+     *            the identifier of the layer
+     * @param resultId
+     *            the unique URI that used in the Advanced Data View to refer to
+     *            this layer
+     * @param type
+     *            the type identifier for the layer
+     * @param qualifier
+     *            an optional layer qualifier to be used in FCS-QL to refer to
+     *            this layer or <code>null</code>
+     * @param altValueInfo
+     *            an additional information about the layer or <code>null</code>
+     * @param altValueInfoURI
+     *            an additional URI for pointing to more information about the
+     *            layer or <code>null</code>
+     */
+    public Layer(String id, URI resultId, String type,
+            ContentEncoding encoding, String qualifier, String altValueInfo,
+            String altValueInfoURI) {
+        if (id == null) {
+            throw new NullPointerException("id == null");
+        }
+        this.id = id;
+
+        if (resultId == null) {
+            throw new NullPointerException("resultId == null");
+        }
+        this.resultId = resultId;
+
+        if (type == null) {
+            throw new NullPointerException("type == null");
+        }
+        this.type = type;
+
+        if (encoding == null) {
+            throw new NullPointerException("encoding == null");
+        }
+        this.encoding = encoding;
+
+        this.qualifier       = qualifier;
+        this.altValueInfo    = altValueInfo;
+        this.altValueInfoURI = altValueInfoURI;
+    }
+
+
+    /**
+     * Constructor.
+     *
+     * @param id
+     *            the identifier of the layer
+     * @param resultId
+     *            the unique URI that used in the Advanced Data View to refer to
+     *            this layer
+     * @param type
+     *            the type identifier for the layer
+     */
+    public Layer(String id, URI resultId, String type) {
+        this(id, resultId, type, ContentEncoding.VALUE, null, null, null);
+    }
+
+
+    /**
+     * Get the identifier for the layer.
+     *
+     * @return the identifier for the layer
+     */
+    public String getId() {
+        return id;
+    }
+
+
+    /**
+     * Get the unique URI that used in the Advanced Data View to refer to this
+     * layer
+     *
+     * @return the URI for referring to this layer in the Advanced Data View
+     */
+    public URI getResultId() {
+        return resultId;
+    }
+
+
+    /**
+     * Get the type identifier for this layer.
+     *
+     * @return the type identifier of the layer
+     */
+    public String getType() {
+        return type;
+    }
+
+
+    /**
+     * Get the content encoding mode for this layer.
+     *
+     * @return the content encoding mode
+     */
+    public ContentEncoding getContentEncoding() {
+        return encoding;
+    }
+
+
+    /**
+     * Get the optional layer qualifier to be used in FCS-QL
+     *
+     * @return the layer qualifier or <code>null</code>
+     */
+    public String getQualifier() {
+        return qualifier;
+    }
+
+
+    /**
+     * Get the additional information about this layer.
+     *
+     * @return an additional information about the layer or <code>null</code>
+     */
+    public String getAltValueInfo() {
+        return altValueInfo;
+    }
+
+
+    /**
+     * Get an additional URI for pointing to more information about this layer.
+     *
+     * @return an additional URI for pointing to more information about the
+     *         layer or <code>null</code>
+     */
+    public String getAltValueInfoURI() {
+        return altValueInfoURI;
+    }
+
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append("[");
+        sb.append("id=").append(id);
+        sb.append(", result-id=").append(resultId);
+        sb.append(", type=").append(type);
+        if (qualifier != null) {
+            sb.append(", qualifier=").append(qualifier);
+        }
+        sb.append("]");
+        return sb.toString();
+    }
+
+} // class Layer
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/ResourceInfo.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/ResourceInfo.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/ResourceInfo.java	(revision 6830)
@@ -19,4 +19,5 @@
     private final List<String> languages;
     private final List<DataView> availableDataViews;
+    private final List<Layer> availableLayers;
     private final List<ResourceInfo> subResources;
 
@@ -42,4 +43,7 @@
      * @param availableDataViews
      *            the list of available data views for this resource
+     * @param availableLayers
+     *            the list if layers available for Advanced Search or
+     *            <code>null</code> if not applicable
      * @param subResources
      *            a list of resource sub-ordinate to this resource or
@@ -49,4 +53,5 @@
             Map<String, String> description, String landingPageURI,
             List<String> languages, List<DataView> availableDataViews,
+            List<Layer> availableLayers,
             List<ResourceInfo> subResources) {
         if (pid == null) {
@@ -83,4 +88,11 @@
                 Collections.unmodifiableList(availableDataViews);
 
+        if ((availableLayers != null) && !availableDataViews.isEmpty()) {
+            this.availableLayers =
+                    Collections.unmodifiableList(availableLayers);
+        } else {
+            this.availableLayers = null;
+        }
+
         if ((subResources != null) && !subResources.isEmpty()) {
             this.subResources = Collections.unmodifiableList(subResources);
@@ -182,4 +194,36 @@
 
     /**
+     * Get the list of data views that are available for this resource.
+     *
+     * @return the list of data views
+     */
+    public List<DataView> getAvailableDataViews() {
+        return availableDataViews;
+    }
+
+
+    /**
+     * Get the list of layers that are available in Advanced Search for this
+     * resource.
+     *
+     * @return the list of layers or <code>null</code>
+     */
+    public List<Layer> getAvailableLayers() {
+        return availableLayers;
+    }
+
+
+    /**
+     * Check if any layers are available for Advanced Search
+     *
+     * @return <code>true</code> if any layer for Advanced Search is available,
+     *         <code>false</code> otherwise
+     */
+    public boolean hasAvailableLayers() {
+        return (availableLayers != null);
+    }
+
+
+    /**
      * Get the direct sub-ordinate resources of this resource.
      *
@@ -191,8 +235,3 @@
     }
 
-
-	public List<DataView> getAvailableDataViews() {
-		return availableDataViews;
-	}
-
 } // class ResourceInfo
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/SimpleEndpointSearchEngineBase.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/SimpleEndpointSearchEngineBase.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/SimpleEndpointSearchEngineBase.java	(revision 6830)
@@ -39,5 +39,5 @@
             "http://clarin.eu/fcs/endpoint-description";
     private static final String ED_PREFIX = "ed";
-    private static final int ED_VERSION = 1;
+    private static final int ED_VERSION = 2;
     private static final Logger logger =
             LoggerFactory.getLogger(SimpleEndpointSearchEngineBase.class);
@@ -239,5 +239,5 @@
         writer.writeAttribute("version", Integer.toString(ED_VERSION));
 
-        // capabilities
+        // Capabilities
         writer.writeStartElement(ED_NS, "Capabilities");
         for (URI capability : endpointDescription.getCapabilities()) {
@@ -248,5 +248,5 @@
         writer.writeEndElement(); // "Capabilities" element
 
-        // supported data views
+        // SupportedDataViews
         writer.writeStartElement(ED_NS, "SupportedDataViews");
         for (DataView dataView : endpointDescription.getSupportedDataViews()) {
@@ -272,6 +272,36 @@
         writer.writeEndElement(); // "SupportedDataViews" element
 
+        // SupportedLayers
+        final List<Layer> layers = endpointDescription.getSupportedLayers();
+        if (layers != null) {
+            writer.writeStartElement(ED_NS, "SupportedLayers");
+            for (Layer layer : layers) {
+                writer.writeStartElement(ED_NS, "SupportedLayer");
+                writer.writeAttribute("id", layer.getId());
+                writer.writeAttribute("result-id",
+                        layer.getResultId().toString());
+                if (layer.getContentEncoding() == Layer.ContentEncoding.EMPTY) {
+                    writer.writeAttribute("type", "empty");
+                }
+                if (layer.getQualifier() != null) {
+                    writer.writeAttribute("qualifier", layer.getQualifier());
+                }
+                if (layer.getAltValueInfo() != null) {
+                    writer.writeAttribute("alt-value-info",
+                            layer.getAltValueInfo());
+                    if (layer.getAltValueInfoURI() != null) {
+                        writer.writeAttribute("alt-value-info-uri",
+                                layer.getAltValueInfoURI());
+                    }
+                }
+                writer.writeCharacters(layer.getType());
+                writer.writeEndElement(); // "SupportedLayer" element
+            }
+            writer.writeEndElement(); // "SupportedLayers" element
+
+        }
+
+        // Resources
         try {
-            // resources
             List<ResourceInfo> resources =
                     endpointDescription.getResourceList(
@@ -351,4 +381,17 @@
                 writer.writeAttribute("ref", sb.toString());
 
+                final List<Layer> layers = resource.getAvailableLayers();
+                if (layers != null) {
+                    sb = new StringBuilder();
+                    for (Layer layer : resource.getAvailableLayers()) {
+                        if (sb.length() > 0) {
+                            sb.append(" ");
+                        }
+                        sb.append(layer.getId());
+                    }
+                    writer.writeEmptyElement(ED_NS, "AvailableLayers");
+                    writer.writeAttribute("ref", sb.toString());
+                }
+
                 // child resources
                 List<ResourceInfo> subs = resource.getSubResources();
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/AbstractEndpointDescriptionBase.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/AbstractEndpointDescriptionBase.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/AbstractEndpointDescriptionBase.java	(revision 6830)
@@ -7,4 +7,5 @@
 import eu.clarin.sru.server.fcs.DataView;
 import eu.clarin.sru.server.fcs.EndpointDescription;
+import eu.clarin.sru.server.fcs.Layer;
 
 
@@ -19,4 +20,6 @@
     protected final List<URI> capabilities;
     protected final List<DataView> supportedDataViews;
+    protected final List<Layer> supportedLayers;
+
 
     /**
@@ -29,5 +32,5 @@
      */
     protected AbstractEndpointDescriptionBase(List<URI> capabilities,
-            List<DataView> supportedDataViews) {
+            List<DataView> supportedDataViews, List<Layer> supportedLayers) {
         if (capabilities == null) {
             throw new NullPointerException("capabilities == null");
@@ -58,4 +61,17 @@
         this.supportedDataViews =
                 Collections.unmodifiableList(supportedDataViews);
+
+        if ((supportedLayers != null) && !supportedLayers.isEmpty()) {
+            for (Layer layer : supportedLayers) {
+                if (layer == null) {
+                    throw new IllegalArgumentException(
+                            "supportedLayers must not contain a 'null' item");
+                }
+            }
+            this.supportedLayers =
+                    Collections.unmodifiableList(supportedLayers);
+        } else {
+            this.supportedLayers = null;
+        }
     }
 
@@ -72,3 +88,9 @@
     }
 
+
+    @Override
+    public List<Layer> getSupportedLayers() {
+        return supportedLayers;
+    }
+
 } // abstract class EndpointDescriptionBase
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescription.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescription.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescription.java	(revision 6830)
@@ -8,4 +8,5 @@
 import eu.clarin.sru.server.fcs.DataView;
 import eu.clarin.sru.server.fcs.EndpointDescription;
+import eu.clarin.sru.server.fcs.Layer;
 import eu.clarin.sru.server.fcs.ResourceInfo;
 
@@ -32,4 +33,7 @@
      * @param supportedDataViews
      *            a list of data views that are supported by this endpoint
+     * @param supportedLayers
+     *            a list of layers supported for Advanced Search by this
+     *            endpoint or <code>null</code>
      * @param resources
      *            a static list of resource info records
@@ -40,7 +44,9 @@
      */
     public SimpleEndpointDescription(List<URI> capabilities,
-            List<DataView> supportedDataViews, List<ResourceInfo> resources,
+            List<DataView> supportedDataViews,
+            List<Layer> supportedLayers,
+            List<ResourceInfo> resources,
             boolean pidCaseSensitive) {
-        super(capabilities, supportedDataViews);
+        super(capabilities, supportedDataViews, supportedLayers);
 
         if (resources == null) {
Index: FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java
===================================================================
--- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java	(revision 6826)
+++ FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java	(revision 6830)
@@ -36,4 +36,5 @@
 import eu.clarin.sru.server.fcs.DataView.DeliveryPolicy;
 import eu.clarin.sru.server.fcs.EndpointDescription;
+import eu.clarin.sru.server.fcs.Layer;
 import eu.clarin.sru.server.fcs.ResourceInfo;
 
@@ -54,6 +55,8 @@
     private static final String NS_LEGACY =
             "http://clarin.eu/fcs/1.0/resource-info";
-    private static final String CAP_BASIC_SEARCH =
-            "http://clarin.eu/fcs/capability/basic-search";
+    private static final URI CAP_BASIC_SEARCH =
+            URI.create("http://clarin.eu/fcs/capability/basic-search");
+    private static final URI CAP_ADVANCED_SEARCH =
+            URI.create("http://clarin.eu/fcs/capability/advanced-search");
     private static final String LANG_EN = "en";
     private static final String POLICY_SEND_DEFAULT = "send-by-default";
@@ -140,11 +143,12 @@
         // capabilities
         List<URI> capabilities = new ArrayList<URI>();
-        XPathExpression exp1 =
+        XPathExpression exp =
                 xpath.compile("//ed:Capabilities/ed:Capability");
-        NodeList list1 = (NodeList) exp1.evaluate(doc, XPathConstants.NODESET);
-        if ((list1 != null) && (list1.getLength() > 0)) {
+        NodeList list =
+                (NodeList) exp.evaluate(doc, XPathConstants.NODESET);
+        if ((list != null) && (list.getLength() > 0)) {
             logger.debug("parsing capabilities");
-            for (int i = 0; i < list1.getLength(); i++) {
-                String s = list1.item(i).getTextContent().trim();
+            for (int i = 0; i < list.getLength(); i++) {
+                String s = list.item(i).getTextContent().trim();
                 try {
                     URI uri = new URI(s);
@@ -163,10 +167,9 @@
                     "endpoint configuration");
         }
-        URI cap = URI.create(CAP_BASIC_SEARCH);
-        if (!capabilities.contains(cap)) {
+        if (!capabilities.contains(CAP_BASIC_SEARCH)) {
             logger.warn("capability '{}' was not defined in endpoint " +
                     "description; added it to meet specification. Please " +
                     "update your endpoint description!", CAP_BASIC_SEARCH);
-            capabilities.add(cap);
+            capabilities.add(CAP_BASIC_SEARCH);
         }
         logger.debug("CAPS:'{}'", capabilities);
@@ -174,11 +177,10 @@
         // supported data views
         List<DataView> supportedDataViews = new ArrayList<DataView>();
-        XPathExpression exp2 =
-                xpath.compile("//ed:SupportedDataViews/ed:SupportedDataView");
-        NodeList list2 = (NodeList) exp2.evaluate(doc, XPathConstants.NODESET);
-        if ((list2 != null) && (list2.getLength() > 0)) {
+        exp = xpath.compile("//ed:SupportedDataViews/ed:SupportedDataView");
+        list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET);
+        if ((list != null) && (list.getLength() > 0)) {
             logger.debug("parsing supported data views");
-            for (int i = 0; i < list2.getLength(); i++) {
-                Element item = (Element) list2.item(i);
+            for (int i = 0; i < list.getLength(); i++) {
+                Element item = (Element) list.item(i);
                 String id = getAttribute(item, "id");
                 if (id == null) {
@@ -238,11 +240,76 @@
 
 
+        // supported layers
+        List<Layer> supportedLayers = null;
+        exp = xpath.compile("//ed:SupportedLayers/ed:SupportedLayer");
+        list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET);
+        if ((list != null) && (list.getLength() > 0)) {
+            logger.debug("parsing supported layers");
+            for (int i = 0; i < list.getLength(); i++) {
+                Element item = (Element) list.item(i);
+                String id = getAttribute(item, "id");
+                if (id == null) {
+                    throw new SRUConfigException("Element <ed:SupportedLayer> "
+                            + "must carry a proper 'id' attribute");
+                }
+                String s = getAttribute(item, "result-id");
+                if (s == null) {
+                    throw new SRUConfigException("Element <ed:SupportedLayer> "
+                            + "must carry a proper 'result-id' attribute");
+                }
+                URI resultId = null;
+                try {
+                    resultId = new URI(s);
+                } catch (URISyntaxException e) {
+                    throw new SRUConfigException("Attribute 'result-id' on " +
+                            "Element <ed:SupportedLayer> is not encoded " +
+                            "as proper URI: " + s);
+                }
+
+                String type = cleanString(item.getTextContent());
+                if ((type != null) && !type.isEmpty()) {
+
+                } else {
+                    throw new SRUConfigException("Element <ed:SupportedLayer> "
+                            + "as no proper type");
+                }
+
+                String qualifier = getAttribute(item, "qualifier");
+
+                // FIXME: implement parsing of content encoding!
+                Layer.ContentEncoding encoding =
+                        Layer.ContentEncoding.VALUE;
+
+                String altValueInfo = getAttribute(item, "alt-value-info");
+                String altValueInfoURI = null;
+                if (altValueInfo != null) {
+                    altValueInfoURI = getAttribute(item, "alt-value-info-uri");
+                }
+
+
+
+                if (supportedLayers == null) {
+                    supportedLayers = new ArrayList<Layer>(list.getLength());
+                }
+                supportedLayers.add(new Layer(id, resultId, type, encoding,
+                        qualifier, altValueInfo, altValueInfoURI));
+            }
+        }
+
+        if ((supportedLayers != null) &&
+                !capabilities.contains(CAP_ADVANCED_SEARCH)) {
+                logger.warn("capability '{}' was not defined in endpoint " +
+                        "description; added it to meet specification. Please " +
+                        "update your endpoint description!", CAP_ADVANCED_SEARCH);
+                capabilities.add(CAP_ADVANCED_SEARCH);
+        }
+        logger.debug("L: {}", supportedLayers);
+
         // resources
-        XPathExpression x3 =
-                xpath.compile("/ed:EndpointDescription/ed:Resources/ed:Resource");
-        NodeList l3 = (NodeList) x3.evaluate(doc, XPathConstants.NODESET);
+        exp = xpath.compile("/ed:EndpointDescription/ed:Resources/ed:Resource");
+        list = (NodeList) exp.evaluate(doc, XPathConstants.NODESET);
         final Set<String> ids = new HashSet<String>();
-        List<ResourceInfo> resources =
-                parseRessources(xpath, l3, ids, supportedDataViews);
+        List<ResourceInfo> resources = parseRessources(xpath, list, ids,
+                supportedDataViews, supportedLayers);
         if ((resources == null) || resources.isEmpty()) {
             throw new SRUConfigException("No resources where " +
@@ -252,4 +319,5 @@
         return new SimpleEndpointDescription(capabilities,
                 supportedDataViews,
+                supportedLayers,
                 resources,
                 false);
@@ -258,7 +326,8 @@
 
     private static List<ResourceInfo> parseRessources(XPath xpath,
-            NodeList nodes, Set<String> ids, List<DataView> supportedDataViews)
-            throws SRUConfigException, XPathExpressionException {
-      List<ResourceInfo> ris = null;
+            NodeList nodes, Set<String> ids, List<DataView> supportedDataViews,
+            List<Layer> supportedLayers)
+                    throws SRUConfigException, XPathExpressionException {
+        List<ResourceInfo> ris = null;
       for (int k = 0; k < nodes.getLength(); k++) {
           final Element node                = (Element) nodes.item(k);
@@ -269,4 +338,5 @@
           List<String> langs                = null;
           List<DataView> availableDataViews = null;
+          List<Layer> availableLayers       = null;
           List<ResourceInfo> sub            = null;
 
@@ -435,5 +505,6 @@
           NodeList l6 = (NodeList) x6.evaluate(node, XPathConstants.NODESET);
           if ((l6 != null) && (l6.getLength() > 0)) {
-              sub = parseRessources(xpath, l6, ids, supportedDataViews);
+              sub = parseRessources(xpath, l6, ids,
+                      supportedDataViews, supportedLayers);
           }
 
@@ -447,4 +518,5 @@
                   langs,
                   availableDataViews,
+                  availableLayers,
                   sub));
       }
