Index: /vlo/branches/vlo-3.0/vlo-web-app/pom.xml
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/pom.xml	(revision 4668)
+++ /vlo/branches/vlo-3.0/vlo-web-app/pom.xml	(revision 4669)
@@ -137,4 +137,10 @@
             <artifactId>guava</artifactId>
             <version>16.0.1</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.saxon</groupId>
+            <artifactId>Saxon-HE</artifactId>
+            <version>9.5.1-4</version>
+            <type>jar</type>
         </dependency>
     </dependencies>
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java	(revision 4668)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java	(revision 4669)
@@ -1,4 +1,5 @@
 package eu.clarin.cmdi.vlo;
 
+import eu.clarin.cmdi.vlo.service.XmlTransformationService;
 import eu.clarin.cmdi.vlo.service.solr.SolrDocumentService;
 import eu.clarin.cmdi.vlo.wicket.pages.FacetedSearchPage;
@@ -24,4 +25,6 @@
     @Autowired
     private SolrDocumentService documentService;
+    @Autowired
+    private XmlTransformationService cmdiTransformationService;
 
     private ApplicationContext applicationContext;
@@ -74,7 +77,19 @@
     }
 
+    /**
+     *
+     * @return a service that retrieves SolrDocuments from the attached index
+     */
     public SolrDocumentService getDocumentService() {
         return documentService;
     }
 
+    /**
+     *
+     * @return a service that transforms CMDI documents to HTML representations
+     */
+    public XmlTransformationService getCmdiTransformationService() {
+        return cmdiTransformationService;
+    }
+
 }
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java	(revision 4668)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/config/VloSpringConfig.java	(revision 4669)
@@ -27,4 +27,5 @@
 import eu.clarin.cmdi.vlo.service.ResourceStringConverter;
 import eu.clarin.cmdi.vlo.service.ResourceTypeCountingService;
+import eu.clarin.cmdi.vlo.service.XmlTransformationService;
 import eu.clarin.cmdi.vlo.service.solr.SearchResultsDao;
 import eu.clarin.cmdi.vlo.service.solr.SolrDocumentService;
@@ -33,4 +34,5 @@
 import eu.clarin.cmdi.vlo.service.impl.ResourceStringConverterImpl;
 import eu.clarin.cmdi.vlo.service.impl.ResourceTypeCountingServiceImpl;
+import eu.clarin.cmdi.vlo.service.impl.XmlTransformationServiceImpl;
 import eu.clarin.cmdi.vlo.service.solr.impl.SearchResultsDaoImpl;
 import eu.clarin.cmdi.vlo.service.solr.impl.SolrDocumentQueryFactoryImpl;
@@ -39,4 +41,9 @@
 import eu.clarin.cmdi.vlo.service.solr.impl.SolrFacetQueryFactoryImpl;
 import java.io.IOException;
+import java.util.Properties;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.stream.StreamSource;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.impl.HttpSolrServer;
@@ -125,4 +132,15 @@
     }
 
+    @Bean
+    public XmlTransformationService cmdiTransformationService() throws TransformerConfigurationException {
+        final Source xsltSource = new StreamSource(getClass().getResourceAsStream("/cmdi2xhtml.xsl"));
+        //TODO: Read properties from file??
+        final Properties transformationProperties = new Properties();
+        transformationProperties.setProperty(OutputKeys.METHOD, "html");
+        transformationProperties.setProperty(OutputKeys.INDENT, "yes");
+        transformationProperties.setProperty(OutputKeys.ENCODING, "UTF-8");
+        return new XmlTransformationServiceImpl(xsltSource, transformationProperties);
+    }
+
     @Bean(name = "basicPropertiesFilter")
     public FieldFilter basicPropertiesFieldFilter() {
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/XmlTransformationService.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/XmlTransformationService.java	(revision 4669)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/XmlTransformationService.java	(revision 4669)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.vlo.service;
+
+import java.net.URL;
+import javax.xml.transform.TransformerException;
+
+/**
+ *
+ * @author twagoo
+ */
+public interface XmlTransformationService {
+
+    /**
+     *
+     * @param location location of XML document to transform (should not be
+     * null)
+     * @return the result of the XML transformation as a string
+     * @throws TransformerException If an unrecoverable error occurs during the
+     * course of the transformation or while opening the input stream.
+     */
+    String transformXml(URL location) throws TransformerException;
+}
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/XmlTransformationServiceImpl.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/XmlTransformationServiceImpl.java	(revision 4669)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/XmlTransformationServiceImpl.java	(revision 4669)
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.vlo.service.impl;
+
+import eu.clarin.cmdi.vlo.service.XmlTransformationService;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.Properties;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Transforms input documents to a fixed stylesheet (determined on construction)
+ * using JAXP XSLT support.
+ *
+ * Thread-safe
+ *
+ * @author twagoo
+ */
+public class XmlTransformationServiceImpl implements XmlTransformationService {
+
+    private final static Logger logger = LoggerFactory.getLogger(XmlTransformationServiceImpl.class);
+
+    private final Templates template;
+    private final Properties transformationProperties;
+
+    /**
+     *
+     * @param xsltSource source of the stylesheet to use in {@link #transformXml(java.net.URL)
+     * }
+     * @
+     * param properties transformation properties to be passed to the
+     * transformer object before transformation
+     * @throws TransformerConfigurationException if the transformer could not be
+     * configured correctly
+     */
+    public XmlTransformationServiceImpl(Source xsltSource, Properties properties) throws TransformerConfigurationException {
+        final TransformerFactory transformerFactory = TransformerFactory.newInstance();
+        // create a template to derive transformers from, which makes this thread safe
+        this.template = transformerFactory.newTemplates(xsltSource);
+        this.transformationProperties = properties;
+
+        logger.debug("Transformation service created for {} with properties {}", xsltSource, properties);
+    }
+
+    /**
+     *
+     * @param location location of XML document to transform (should not be
+     * null)
+     * @return the result of the XML transformation as a string
+     * @throws TransformerException If an unrecoverable error occurs during the
+     * course of the transformation or while opening the input stream.
+     */
+    @Override
+    public String transformXml(URL location) throws TransformerException {
+        logger.debug("Transforming {}", location);
+
+        // create a transformer based on the template
+        final Transformer transformer = template.newTransformer();
+        transformer.setOutputProperties(transformationProperties);
+
+        try {
+            final InputStream inStream = location.openStream();
+            final StringWriter outWriter = new StringWriter();
+
+            // make input/output objects
+            final Source source = new StreamSource(inStream);
+            final Result result = new StreamResult(outWriter);
+
+            // perform actual transformation (this will also close the streams)
+            transformer.transform(source, result);
+
+            // result has been written to string writer, return contents
+            return outWriter.toString();
+        } catch (IOException ex) {
+            throw new TransformerException("Error while opening input stream for " + location.toString(), ex);
+        }
+
+    }
+
+}
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/UrlFromStringModel.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/UrlFromStringModel.java	(revision 4669)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/UrlFromStringModel.java	(revision 4669)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.vlo.wicket.model;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.wicket.model.IModel;
+
+/**
+ *
+ * @author twagoo
+ */
+public class UrlFromStringModel implements IModel<URL> {
+
+    private final IModel<String> model;
+
+    public UrlFromStringModel(IModel<String> model) {
+        this.model = model;
+    }
+
+    @Override
+    public URL getObject() {
+        if (model.getObject() == null) {
+            return null;
+        } else {
+            try {
+                return new File(model.getObject()).toURI().toURL();
+            } catch (MalformedURLException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }
+
+    @Override
+    public void setObject(URL object) {
+        if (object == null) {
+            model.setObject(null);
+        } else {
+            model.setObject(object.toString());
+        }
+    }
+
+    @Override
+    public void detach() {
+        model.detach();
+    }
+
+}
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/XsltModel.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/XsltModel.java	(revision 4669)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/model/XsltModel.java	(revision 4669)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 CLARIN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package eu.clarin.cmdi.vlo.wicket.model;
+
+import eu.clarin.cmdi.vlo.VloWicketApplication;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.net.URL;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.stream.StreamSource;
+import net.sf.saxon.s9api.Processor;
+import net.sf.saxon.s9api.SaxonApiException;
+import net.sf.saxon.s9api.Serializer;
+import net.sf.saxon.s9api.XdmNode;
+import net.sf.saxon.s9api.XsltCompiler;
+import net.sf.saxon.s9api.XsltExecutable;
+import net.sf.saxon.s9api.XsltTransformer;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.LoadableDetachableModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Model that renders a CMDI in XHMTL by means of a stylesheet. This model
+ * discards the result of the transformation on detach to prevent large XHTML
+ * content from being cached.
+ *
+ * @author twagoo
+ */
+public class XsltModel extends LoadableDetachableModel<String> {
+
+    private final static Logger logger = LoggerFactory.getLogger(XsltModel.class);
+    private final IModel<URL> metadataUrl;
+
+    /**
+     *
+     * @param metadataUrl URL of the metadata file to be presented
+     */
+    public XsltModel(IModel<URL> metadataUrl) {
+        this.metadataUrl = metadataUrl;
+    }
+
+    /**
+     * Creates the XHTML representation to be shown
+     *
+     * @return
+     */
+    @Override
+    protected String load() {
+        final URL object = metadataUrl.getObject();
+        if (object == null) {
+            return "";
+        }
+        try {
+            return VloWicketApplication.get().getCmdiTransformationService().transformXml(object);
+        } catch (TransformerException ex) {
+            logger.error("Could not transform {}", object, ex);
+            return ("<b>Could not load complete CMDI metadata</b>");
+        }
+
+    }
+
+}
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html	(revision 4668)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.html	(revision 4669)
@@ -71,162 +71,5 @@
                     <a href="#" id="hiderecordcmdi" class="recordhidelink">Hide all metadata fields</a>
                 </p>
-                <div id="recordcmdi">
-                    <h2>CMDI Metadata</h2>
-                    <!--<p><a href="#" id="recordcmditoggle">View/Hide CMDI metadata</a></p>-->
-                    <article xmlns:cmd="http://www.clarin.eu/cmd/" xmlns:fn="http://www.w3.org/2005/xpath-functions" style="background-color:#EEEEEE">
-                        <div class="endgame">
-                            <p>
-                                <h1>Resources</h1>
-                                <table>
-                                    <caption>Resources</caption>
-                                    <thead>
-                                        <tr>
-                                            <th class="attribute">Reference to resource</th>
-                                            <th class="attribute">Resource description</th>
-                                            <th class="attribute">Resource MIME type</th>
-                                            <th class="attribute">Resource Proxy ID</th>
-                                        </tr>
-                                    </thead>
-                                    <tbody class="attributesTbody">
-                                        <tr>
-                                            <td class="attributeValue"><a href="http://dspace.library.uu.nl/handle/1874/205294">http://dspace.library.uu.nl/handle/1874/205294</a></td>
-                                            <td class="attributeValue">LandingPage</td>
-                                            <td class="attributeValue">text/html</td>
-                                            <td class="attributeValue">h.1874.205294</td>
-                                        </tr>
-                                        <tr>
-                                            <td class="attributeValue"><a href="http://dspace.library.uu.nl/bitstream/1874/205294/1/Masterthesis+Carolyn+van+de+Wall.docx">http://dspace.library.uu.nl/bitstream/1874/205294/1/Masterthesis+Carolyn+van+de+Wall.docx</a></td>
-                                            <td class="attributeValue">Resource</td>
-                                            <td class="attributeValue">application/octet-stream</td>
-                                            <td class="attributeValue">h.1874.205294.1</td>
-                                        </tr>
-                                    </tbody>
-                                </table>
-                            </p>
-                        </div>
-                        <p>
-                            <h1>Metadata content</h1>
-                            <ul>
-                                <li><code class="node">mods 
-                                        <div class="attributes">version="3.2"
-
-                                        </div></code><ul>
-                                        <ul>
-                                            <li><code class="node">edboOverlap </code><div class="Component_tree_node_content"><code class="leaf">no</code></div>
-                                            </li>
-                                            <li><code class="node">machineReadable </code><div class="Component_tree_node_content"><code class="leaf">unknown</code></div>
-                                            </li>
-                                            <li><code class="node">typeOfResource </code><div class="Component_tree_node_content"><code class="leaf">text</code></div>
-                                            </li>
-                                            <li><code class="node">genre </code><div class="Component_tree_node_content"><code class="leaf">info:eu-repo/semantics/masterThesis</code></div>
-                                            </li>
-                                            <li><code class="node">titleInfo </code><ul>
-                                                    <ul>
-                                                        <li><code class="node">title </code><div class="Component_tree_node_content"><code class="leaf">" De professionaliteit van medisch specialisten onder de loep"</code></div>
-                                                        </li>
-                                                    </ul>
-                                                </ul>
-                                            </li>
-                                            <li><code class="node">name 
-                                                    <div class="attributes">ID="n205294_aut_1"
-                                                        type="personal"
-
-                                                    </div></code><ul>
-                                                    <ul>
-                                                        <li><code class="node">namePart 
-                                                                <div class="attributes">type="family"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf">Wall</code></div>
-                                                        </li>
-                                                        <li><code class="node">namePart 
-                                                                <div class="attributes">type="given"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf"> C.J. van de</code></div>
-                                                        </li>
-                                                        <li><code class="node">role </code><ul>
-                                                                <ul>
-                                                                    <li><code class="node">roleTerm 
-                                                                            <div class="attributes">authority="marcrelator"
-                                                                                type="code"
-
-                                                                            </div></code><div class="Component_tree_node_content"><code class="leaf">aut</code></div>
-                                                                    </li>
-                                                                </ul>
-                                                            </ul>
-                                                        </li>
-                                                    </ul>
-                                                </ul>
-                                            </li>
-                                            <li><code class="node">name 
-                                                    <div class="attributes">ID="n205294_ths_1"
-                                                        type="personal"
-
-                                                    </div></code><ul>
-                                                    <ul>
-                                                        <li><code class="node">namePart 
-                                                                <div class="attributes">type="family"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf">Knies</code></div>
-                                                        </li>
-                                                        <li><code class="node">namePart 
-                                                                <div class="attributes">type="given"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf"> E.</code></div>
-                                                        </li>
-                                                        <li><code class="node">role </code><ul>
-                                                                <ul>
-                                                                    <li><code class="node">roleTerm 
-                                                                            <div class="attributes">authority="marcrelator"
-                                                                                type="code"
-
-                                                                            </div></code><div class="Component_tree_node_content"><code class="leaf">ths</code></div>
-                                                                    </li>
-                                                                </ul>
-                                                            </ul>
-                                                        </li>
-                                                    </ul>
-                                                </ul>
-                                            </li>
-                                            <li><code class="node">originInfo </code><ul>
-                                                    <ul>
-                                                        <li><code class="node">dateCreated 
-                                                                <div class="attributes">encoding="iso8601"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf">2011-03-31</code></div>
-                                                        </li>
-                                                        <li><code class="node">dateCreated 
-                                                                <div class="attributes">encoding="iso8601"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf">2011-05-31</code></div>
-                                                        </li>
-                                                    </ul>
-                                                </ul>
-                                            </li>
-                                            <li><code class="node">language </code><ul>
-                                                    <ul>
-                                                        <li><code class="node">languageTerm 
-                                                                <div class="attributes">authority="rfc3066"
-                                                                    type="code"
-
-                                                                </div></code><div class="Component_tree_node_content"><code class="leaf">nl</code></div>
-                                                        </li>
-                                                    </ul>
-                                                </ul>
-                                            </li>
-                                            <li><code class="node">subject </code><ul>
-                                                    <ul>
-                                                        <li><code class="node">topic </code><div class="Component_tree_node_content"><code class="leaf">professionaliteit, ziekenhuis, medisch specialisten, management, Klink, loondienst,
-                                                                    maatschappen, autonomie, kwaliteit zorg, motivatie, ondersteunend personeel</code></div>
-                                                        </li>
-                                                    </ul>
-                                                </ul>
-                                            </li>
-                                        </ul>
-                                    </ul>
-                                </li>
-                            </ul>
-                        </p>
-                    </article>
-                </div> <!-- recordcmdi -->
+                <div wicket:id="cmdi" id="recordcmdi">[CMDI metadata]</div>
 
                 <p id="recordtechnicaldetailstoggle" class="recordtogglelinks">
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java	(revision 4668)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/RecordPage.java	(revision 4669)
@@ -27,6 +27,9 @@
 import eu.clarin.cmdi.vlo.wicket.model.SolrFieldModel;
 import eu.clarin.cmdi.vlo.wicket.model.SolrFieldStringModel;
+import eu.clarin.cmdi.vlo.wicket.model.UrlFromStringModel;
+import eu.clarin.cmdi.vlo.wicket.model.XsltModel;
 import eu.clarin.cmdi.vlo.wicket.provider.DocumentFieldsProvider;
 import org.apache.solr.common.SolrDocument;
+import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.ExternalLink;
 import org.apache.wicket.model.IModel;
@@ -52,12 +55,12 @@
     public RecordPage(PageParameters params) {
         super(params);
-        
+
         final SolrDocumentModel documentModel = new SolrDocumentModel(params.get("docId").toString());
         setModel(documentModel);
-        
+
         final QueryFacetsSelection selection = selectionParametersConverter.fromParameters(params);
         this.contextModel = Model.of(selection);
-        
-        addComponents(documentModel);
+
+        addComponents();
     }
 
@@ -65,17 +68,23 @@
         super(documentModel);
         this.contextModel = contextModel;
-        addComponents(documentModel);
+        addComponents();
     }
 
-    private void addComponents(IModel<SolrDocument> documentModel) {
-        add(new SolrFieldLabel("name", documentModel, FacetConstants.FIELD_NAME, "Unnamed record"));
-        add(createLandingPageLink("landingPageLink", documentModel));
-        add(new FieldsTablePanel("documentProperties", new DocumentFieldsProvider(documentModel, basicPropertiesFilter)));
-        add(new ResourceLinksPanel("resources", new SolrFieldModel<String>(documentModel, FacetConstants.FIELD_RESOURCE)));
-        add(new FieldsTablePanel("technicalProperties", new DocumentFieldsProvider(documentModel, technicalPropertiesFilter)));
+    private void addComponents() {
+        // General information section
+        add(new SolrFieldLabel("name", getModel(), FacetConstants.FIELD_NAME, "Unnamed record"));
+        add(createLandingPageLink("landingPageLink"));
+        add(new FieldsTablePanel("documentProperties", new DocumentFieldsProvider(getModel(), basicPropertiesFilter)));
+        
+        // Resources section
+        add(new ResourceLinksPanel("resources", new SolrFieldModel<String>(getModel(), FacetConstants.FIELD_RESOURCE)));
+        
+        // Technical section
+        add(createCmdiContent("cmdi"));
+        add(new FieldsTablePanel("technicalProperties", new DocumentFieldsProvider(getModel(), technicalPropertiesFilter)));
     }
 
-    private ExternalLink createLandingPageLink(String id, IModel<SolrDocument> documentModel) {
-        final SolrFieldStringModel landingPageHrefModel = new SolrFieldStringModel(documentModel, FacetConstants.FIELD_LANDINGPAGE);
+    private ExternalLink createLandingPageLink(String id) {
+        final SolrFieldStringModel landingPageHrefModel = new SolrFieldStringModel(getModel(), FacetConstants.FIELD_LANDINGPAGE);
         // add landing page link
         final ExternalLink landingPageLink = new ExternalLink(id, landingPageHrefModel) {
@@ -91,4 +100,12 @@
     }
 
+    private Label createCmdiContent(String id) {
+        final IModel<String> locationModel = new SolrFieldStringModel(getModel(), FacetConstants.FIELD_FILENAME);
+        final UrlFromStringModel locationUrlModel = new UrlFromStringModel(locationModel);
+        final Label cmdiContentLabel = new Label(id, new XsltModel(locationUrlModel));
+        cmdiContentLabel.setEscapeModelStrings(false);
+        return cmdiContentLabel;
+    }
+
     @Override
     public void detachModels() {
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java	(revision 4668)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/provider/FacetFieldValuesProvider.java	(revision 4669)
@@ -35,4 +35,6 @@
  * SOLR) present on a {@link FacetField}, sortable by either count or name
  *
+ * TODO: Add option to hide values with only 1 record (as in VLO 2.x)
+ * 
  * @see FieldValuesOrder
  * @author twagoo
Index: /vlo/branches/vlo-3.0/vlo-web-app/src/main/resources/cmdi2xhtml.xsl
===================================================================
--- /vlo/branches/vlo-3.0/vlo-web-app/src/main/resources/cmdi2xhtml.xsl	(revision 4669)
+++ /vlo/branches/vlo-3.0/vlo-web-app/src/main/resources/cmdi2xhtml.xsl	(revision 4669)
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet 
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:cmd="http://www.clarin.eu/cmd/"
+    xmlns:fn="http://www.w3.org/2005/xpath-functions"
+    exclude-result-prefixes="xs"
+    version="2.0"
+    xpath-default-namespace="http://www.clarin.eu/cmd/">
+    <!--    
+    <!DOCTYPE html>
+    -->
+
+    <xsl:output
+        method="html"
+        encoding="UTF-8"
+        doctype-system="about:legacy-compat"
+        indent="yes"
+        cdata-section-elements="td"/>
+    
+    <xsl:param 
+        name="prune_Components_branches_without_text_values" 
+        as="xs:boolean" 
+        select='false()'/>
+
+    <xsl:template 
+        name="Component_tree" 
+        match="/CMD/Components">
+        <xsl:param 
+            name="nodeset"
+            as="element()+" 
+            select="/CMD/Components"/>
+
+        <ul>
+            <xsl:for-each 
+                select="$nodeset/element()">
+                <xsl:variable 
+                    name="subnodes_text" 
+                    select="fn:normalize-space(fn:string-join(descendant-or-self::element()/text(), ''))" as="xs:string+"/>
+                <xsl:if 
+                    test="not($subnodes_text = '' and $prune_Components_branches_without_text_values)">
+                    <xsl:variable 
+                        name="nchildren" 
+                        select="fn:count(child::element())"/>
+                    <li>
+                     
+                        <code class="node">
+                            <xsl:value-of 
+                                select="fn:concat(local-name(), ' ')"/>
+                            <xsl:if 
+                                test="count(@*) > 0">
+                                <div class="attributes">
+                                    <xsl:for-each 
+                                        select="@*">
+                                        <xsl:value-of 
+                                            select="name()"/>="<xsl:value-of select="."/>"
+                                    </xsl:for-each>
+                                </div>
+                            </xsl:if>
+                        </code>
+                    
+                        <xsl:choose>
+                            <xsl:when 
+                                test="$nchildren = 0 and not(not(child::node()))">
+                                <!--<br /><br />-->
+                                <div class="Component_tree_node_content">
+                                    <xsl:choose>
+                                        <xsl:when
+                                            test="self::element() castable as xs:string">
+                                            <xsl:variable
+                                                name="leaf_value" 
+                                                select="self::element() cast as xs:string"
+                                                as="xs:string"/>                                         
+                                            <xsl:variable
+                                                name="is_URL"
+                                                select="starts-with($leaf_value, 'http://') or starts-with($leaf_value, 'https://')"
+                                                as="xs:boolean"/> 
+                                            <code class="leaf">
+                                                <xsl:choose>
+                                                    <xsl:when 
+                                                        test="$is_URL">
+                                                        <a href="{$leaf_value}">
+                                                            <xsl:value-of 
+                                                                select="$leaf_value"/>
+                                                        </a>
+                                                    </xsl:when>
+                                                    <xsl:otherwise>                                    
+                                                        <xsl:value-of 
+                                                            select="$leaf_value"/>                                         
+                                                    </xsl:otherwise>                                 
+                                                </xsl:choose>
+                                            </code>
+                                        </xsl:when>
+                                        <xsl:otherwise>                                    
+                                            <xsl:variable
+                                                name="leaf_value" 
+                                                select="format-number(self::element(), '#') cast as xs:string"
+                                                as="xs:string"/>
+                                            <xsl:variable
+                                                name="is_URL"
+                                                select="starts-with($leaf_value, 'http://') or starts-with($leaf_value, 'https://')"
+                                                as="xs:boolean"/> 
+                                            <code class="leaf">
+                                                <xsl:choose>
+                                                    <xsl:when 
+                                                        test="$is_URL">
+                                                    <a href="{$leaf_value}"><xsl:value-of select="$leaf_value"/></a>
+                                                    </xsl:when>
+                                                    <xsl:otherwise>                                    
+                                                        <xsl:value-of 
+                                                            select="$leaf_value"/>                                         
+                                                    </xsl:otherwise>                                 
+                                                </xsl:choose>
+                                            </code>                  
+                                        </xsl:otherwise>                                 
+                                    </xsl:choose>
+                                </div>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <ul>
+                                    <xsl:call-template 
+                                        name="Component_tree">
+                                        <xsl:with-param 
+                                            name="nodeset" 
+                                            select="self::element()"/>
+                                    </xsl:call-template>
+                                </ul>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                                     
+                    </li>                                
+                </xsl:if>
+            </xsl:for-each>
+        </ul>
+    </xsl:template>
+
+    <xsl:template match="CMD">
+        <article style="background-color:#EEEEEE">
+            <div class="endgame">
+                <xsl:if test="not(not(Resources/*[normalize-space()]))"> 
+                    <p>                    
+                        <h1>Resources</h1>
+                        <table>
+                            <caption>Resources</caption>
+                            <thead>
+                                <tr>
+                                    <th class="attribute">Reference to resource</th>
+                                    <th class="attribute">Resource description</th>
+                                    <th class="attribute">Resource MIME type</th>
+                                    <th class="attribute">Resource Proxy ID</th>
+                                </tr>
+                            </thead>
+                            <tbody class="attributesTbody">
+                                <xsl:for-each 
+                                    select="Resources/ResourceProxyList/ResourceProxy">
+                                    <xsl:variable 
+                                        name="URI"
+                                        select="ResourceRef/text()"
+                                        as="xs:string"/>
+                                    <tr> 
+                                        <td class="attributeValue">                                                
+                                            <xsl:variable 
+                                                name="protocol"
+                                                select="fn:substring-before($URI, ':')"
+                                                as="xs:string"/>
+                                            <xsl:choose>
+                                                <xsl:when 
+                                                    test="$protocol = 'hdl'">
+                                                    <xsl:variable 
+                                                        name="HANDLE_PREFIX"
+                                                        select="'http://hdl.handle.net'"
+                                                        as="xs:string"/>                                                
+                                                    <xsl:variable 
+                                                        name="Handle_reference"
+                                                        select="fn:substring-after($URI, ':')"
+                                                        as="xs:string"/>
+                                                    <xsl:variable 
+                                                        name="Handle_HTTP_URL"
+                                                        select="fn:concat($HANDLE_PREFIX, '/', $Handle_reference)"
+                                                        as="xs:string"/>
+                                                    <a href="{$Handle_HTTP_URL}">
+                                                        <xsl:value-of
+                                                            select="$Handle_HTTP_URL"/>
+                                                    </a>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                    <a href="{ResourceRef}">
+                                                        <xsl:value-of 
+                                                            select="ResourceRef"/>
+                                                    </a>
+                                                </xsl:otherwise>
+                                            </xsl:choose>                                                
+                                        </td>
+                                        <td class="attributeValue">
+                                            <xsl:value-of select="ResourceType"/>
+                                        </td>
+                                        <td class="attributeValue">
+                                            <xsl:value-of select="ResourceType/@mimetype"/>
+                                        </td>
+                                        <td class="attributeValue">
+                                            <xsl:value-of select="./@id"/>
+                                        </td>
+                                    </tr>
+                                </xsl:for-each>
+                            </tbody>
+                        </table>
+                    </p>
+                </xsl:if>
+            </div>
+                    
+            <p>
+                <h1>Metadata content</h1>
+                <xsl:call-template name="Component_tree"/>
+            </p>
+        </article>
+    </xsl:template>
+</xsl:stylesheet>
