{
Node registryNode = registryEntry.getNode();
NodeIterator registryIterator = registryNode.getNodes();
Document entry = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
String fullURI = uriInfo.getRequestUri().toString();
XlinkHref xlinkHref = new XlinkHref(fullURI);
Element root = entry.createElement(REGISTRY);
xlinkHref.putToElement(root);
while (registryIterator.hasNext())
{
NodeIterator entryIterator = registryIterator.nextNode().getNodes();
while (entryIterator.hasNext())
{
Node node = entryIterator.nextNode();
Element xmlNode = entry.createElement(node.getName());
xlinkHref.putToElement(xmlNode, node.getPath().substring(EXO_REGISTRY.length()));
root.appendChild(xmlNode);
}
}
entry.appendChild(root);
return Response.ok(new DOMSource(entry), "text/xml").build();