code: public static Metadata metadata(Document document) {
  		try {
  			Transformer printFormatTransformer = TRANSFORMER_FACTORY.newTransformer();
  			printFormatTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
  			printFormatTransformer.setOutputProperty(OutputKeys.METHOD, "xml");
  			printFormatTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
  			printFormatTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
  			printFormatTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
  
  			Transformer equalsTransformer = TRANSFORMER_FACTORY.newTransformer();
  			equalsTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
  			equalsTransformer.setOutputProperty(OutputKeys.INDENT, "no");
  			equalsTransformer.setOutputProperty(OutputKeys.METHOD, "xml");
  
  			XPath xPath = XPATH_FACTORY.newXPath();
  
  			return new MetadataWrapperImpl(
  					document,
  					xPath,
  					printFormatTransformer,
  					DEFAULT_NAMESPACE_CONTEXT,
  					equalsTransformer);
  		} catch (TransformerConfigurationException e) {
  			throw new RuntimeException(e);
  		}
  	}
docs: Create a {@link Metadata} instance for the given document.
  
  @param document a metadata document
  @return the wrapped metadata