code: @SuppressWarnings("unchecked")
      private String getFilteredXml(Document document, String xpathExpression) {
          logger.entering(new Object[] { document, xpathExpression });
  
          List<Node> nodes = (List<Node>) document.selectNodes(xpathExpression);
          StringBuilder newDocument = new StringBuilder(document.asXML().length());
          newDocument.append("<root>");
          for (Node n : nodes) {
              newDocument.append(n.asXML());
          }
          newDocument.append("</root>");
  
          logger.exiting(newDocument);
          return newDocument.toString();
      }
docs: Generates an XML string containing only the nodes filtered by the XPath expression.
  
  @param document
  An XML {@link org.dom4j.Document}
  @param xpathExpression
  A string indicating the XPath expression to be evaluated.
  @return A string of XML data with root node named "root".