private String loadXmlDefinition(final Document document)
      throws XPathExpressionException, TransformerFactoryConfigurationError, TransformerException {
    searchString = createQueryString(prefix, type, attributes);
    logger.info("XmlEntity:searchString: {}", searchString);

    if (document != null) {
      XPathContext xpathContext = new XPathContext();
      xpathContext.addNamespace(prefix, namespace);

      // TODO: wrap this line with conditional
      xpathContext.addNamespace(childPrefix, childNamespace);

      // Create an XPathContext here
      Node element = XmlUtils.querySingleElement(document, searchString, xpathContext);

      // Must copy to preserve namespaces.
      if (null != element) {
        return XmlUtils.elementToString(element);
      }
    }

    logger.warn("No XML definition could be found with name={} and attributes={}", type,
        attributes);
    return null;
  }
Used supplied XML {@link Document} to extract the XML for the defined XmlEntity.

@param document to extract XML from.
@return XML for XmlEntity if found, otherwise {@code null}.
@since GemFire 8.1
geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/XmlEntity.java