private PageManifestDef loadRootPageDefinition(String manifestPathOrPath)
     throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
   PageManifestDef pmd = new PageManifestDef();
   Document document = readPageDefinitionFile(manifestPathOrPath, pmd);
   pmd.setSelectorStrategy(selectorExpr.evaluate(document));
   return pmd;
 }
    public PageManifestDef read(FileScope fileScope, Document document, PageManifestDef pmd)
        throws XPathExpressionException {
      this.fileScope = fileScope;
      XmlUtils.iterateSubElements(
          document, resourcesExpr, e -> pmd.addResourceSet(readResourcesDefinition(e)));
      XmlUtils.iterateSubElements(
          document, fragmentsExpr, e -> pmd.addFragments(readFragmentDefinition(e)));
      XmlUtils.iterateSubElements(document, viewsExpr, e -> pmd.addView(readViewDefinition(e)));

      List<String> imports =
          XmlUtils.getSingleAttrNodes(
              document, importsExpr, "file", "import tag must contain file attribute");

      imports
          .stream()
          .forEach(
              i ->
                  XMLPageManifestLoader.this.readPageDefinitionFile(
                      fileScope.getRelativePath(i), pmd));

      return pmd;
    }