diff --git a/notes.txt b/notes.txt
index 26bb1de27c9c8290e08442c8b081d837d3564cbc..1c8646222f7acce4fb08179556d7ed4e69c9c8d2 100644
--- a/notes.txt
+++ b/notes.txt
@@ -1,3 +1,7 @@
+p. 3: "The value of the @version attribute MUST be 2." But SRU 1.2 EndpointDescription will have version="1", per example on p. 12. (By the way, some examples are numbered and some are not.)
+
+p. 4: Link 'section "Layers"' leads to a CLARIN-internal Trac instance.
+
 p. 10: "Send explain request without version and operation parameter" -- but an explain request has to have the operation parameter with 'explain' as its value
 
 p. 14: x-cmd-resource-info parameter present in the query example, but never explained (mentioned in some 2013 slides on FCS; should now probably be x-fcs-endpoint-description)
diff --git a/static/endpoint_description.xml b/static/endpoint_description.xml
index d68eaa5e410a0ff772edb2f3ed6e96a02386eaa3..2aac1cb9f8665bba0f38fc22bd551d5e1bdff3fc 100644
--- a/static/endpoint_description.xml
+++ b/static/endpoint_description.xml
@@ -1,20 +1,26 @@
     <sru:extraResponseData>
-        <ed:EndpointDescription xmlns:ed="http://clarin.eu/fcs/endpoint-description" version="1">
-            <ed:Capabilities>
-                <ed:Capability>http://clarin.eu/fcs/capability/basic-search</ed:Capability>
+        <ed:EndpointDescription xmlns:ed="http://clarin.eu/fcs/endpoint-description" version="{{ ep_version }}">
+            <ed:Capabilities>{% if capability_basic_search %}
+                <ed:Capability>http://clarin.eu/fcs/capability/basic-search</ed:Capability>{% endif %}{% if capability_advanced_search and ep_version >= 2 %}
+                <ed:Capability>http://clarin.eu/fcs/capability/advanced-search</ed:Capability>{% endif %}
             </ed:Capabilities>
-            <ed:SupportedDataViews>
-                <ed:SupportedDataView id="hits" delivery-policy="send-by-default">application/x-clarin-fcs-hits+xml</ed:SupportedDataView>
-            </ed:SupportedDataViews>
+            <ed:SupportedDataViews>{% if hits_supported %}
+                <ed:SupportedDataView id="hits" delivery-policy="send-by-default">application/x-clarin-fcs-hits+xml</ed:SupportedDataView>{% endif %}{% if adv_supported and ep_version >= 2%}
+                <ed:SupportedDataView id="adv" delivery-policy="send-by-default">application/x-clarin-fcs-adv+xml</ed:SupportedDataView>{% endif %}
+            </ed:SupportedDataViews>{% if capability_advanced_search and ep_version >= 2 %}
+            <ed:SupportedLayers>{% for layer in supported_layers %}
+                <ed:SupportedLayer id="{{ layer.id }}" result-id="{{ layer.result_id }}"{% if layer.alt_value_info %} alt-value-info="{{ layer.alt_value_info }}"{% endif %}{% if layer.alt_value_info_uri %} alt-value-info-uri="{{ layer.alt_value_info_uri }}"{% endif %}{% if layer.qualifier %} qualifier="{{ layer.qualifier }}"{% endif %}>{{ layer.layer_type }}</ed:SupportedLayer>{% endfor %}
+            </ed:SupportedLayers>
+            {% endif %}
             <ed:Resources>{% for r in resources %}
                 <ed:Resource pid="{{ r.pid }}">{% for title in r.titles %}
                     <ed:Title xml:lang="{{ title.lang }}">{{ title.content }}</ed:Title>{% endfor %}{% for desc in r.descriptions %}
-                    <ed:Description xml:lang="{{ desc.lang }}">{{ desc.content }}</ed:Description>
-                    <ed:LandingPageURI>{{ r.landing_page }}</ed:LandingPageURI>{% if r.languages|length > 0 %}
+                    <ed:Description xml:lang="{{ desc.lang }}">{{ desc.content }}</ed:Description>{% if landing_page|length > 0%}
+                    <ed:LandingPageURI>{{ r.landing_page }}</ed:LandingPageURI>{% endif %}
                     <ed:Languages>{% for lang in r.languages %}
                         <ed:Language>{{ lang }}</ed:Language>{% endfor %}
-                    </ed:Languages>{% endif %}
-                    <ed:AvailableDataViews ref="hits"/>
+                    </ed:Languages>
+                    <ed:AvailableDataViews ref="{{ r.data_views }}"/>
                 </ed:Resource>{% endfor %}
             </ed:Resources>
         </ed:EndpointDescription>
diff --git a/static/explain_response_1.2.xml b/static/explain_response_1.2.xml
index 1cedcb7af471cd82d07863cf3985562ecd534104..0b80d08fa7b1460f406cc91182feca45fa8d5387 100644
--- a/static/explain_response_1.2.xml
+++ b/static/explain_response_1.2.xml
@@ -1,3 +1,4 @@
+{% set ep_version = 1 %}
 <?xml version='1.0' encoding='utf-8'?>
 <sru:explainResponse xmlns:sru="http://www.loc.gov/zing/srw/">
     <sru:version>1.2</sru:version>