private static DocumentNode RewriteMerged(IDescriptorContext context, DocumentNode schema)
        {
            IReadOnlyList <Func <DocumentNode, DocumentNode> > mergedDocRewriter =
                context.GetMergedDocRewriter();

            if (mergedDocRewriter.Count == 0)
            {
                return(schema);
            }

            DocumentNode current = schema;

            foreach (Func <DocumentNode, DocumentNode> rewriter in mergedDocRewriter)
            {
                current = rewriter.Invoke(current);
            }

            return(current);
        }