code: private XDOM createXDOM(String content, MacroTransformationContext macroContext, boolean transform,
          MetaData metadata, boolean inline, Syntax syntax) throws MacroExecutionException
      {
          try {
              XDOM result = getSyntaxParser(syntax).parse(new StringReader(content));
  
              if (metadata != null) {
                  result.getMetaData().addMetaData(metadata);
              }
  
              if (transform && macroContext.getTransformation() != null) {
                  TransformationContext txContext = new TransformationContext(result, syntax);
                  txContext.setId(macroContext.getId());
                  performTransformation((MutableRenderingContext) this.renderingContext,
                      macroContext.getTransformation(), txContext, result);
              }
  
              if (inline) {
                  result = convertToInline(result);
              }
  
              return result;
          } catch (Exception e) {
              throw new MacroExecutionException("Failed to parse content [" + content + "]", e);
          }
      }
docs: creates XDOM.