docs: function add(name, methods) {
  
    // Create a container class that extends Document for our methods.
    class ConcreteDocument extends Document {
      constructor(document, root) {
        super(name, document, root);
      }
    }
  
    // Assign the methods to the new classes prototype.
    assignIn(ConcreteDocument.prototype, methods);
  
    // Add a factory method for the new type.
    Document.factory[name] = (document, root) => new ConcreteDocument(document, root);
  }