code: protected String getDefaultString() {
          final StringBuilder output = new StringBuilder();
          // append headers e.g. namespaces and functions
          output.append(String.join("\n", getHeaders()));
  
          output
                  .append("for $m in ").append(getPathToRoot()).append(" return\n")
                  .append("for $x in $m//*:").append(NonWhitespaceNodeList.getFirstChild(getMainElement()).getLocalName())
                  .append("\n")
                  .append(getExactMatchXQuery());
  
          if (!getLengthConstraint().isEmpty()) {
              output.append("\n").append("where").append("\n").append(getLengthConstraint());
          }
  
          // append return format
          output.append("\n\n")
                  .append("return").append("\n").append(getReturnFormat());
  
          // append footers e.g. closing fences from headers
          output.append(String.join("\n", getFooters()));
          return output.toString();
      }
docs: Builds the XQuery as a string. Uses the default format of looping through all apply nodes.
  
  @return XQuery as string