code: public ElemTemplateElement appendChild(ElemTemplateElement newChild)
    {
  
      int type = ((ElemTemplateElement) newChild).getXSLToken();
  
      switch (type)
      {
  
      // char-instructions 
      case Constants.ELEMNAME_TEXTLITERALRESULT :
      case Constants.ELEMNAME_APPLY_TEMPLATES :
      case Constants.ELEMNAME_APPLY_IMPORTS :
      case Constants.ELEMNAME_CALLTEMPLATE :
      case Constants.ELEMNAME_FOREACH :
      case Constants.ELEMNAME_VALUEOF :
      case Constants.ELEMNAME_COPY_OF :
      case Constants.ELEMNAME_NUMBER :
      case Constants.ELEMNAME_CHOOSE :
      case Constants.ELEMNAME_IF :
      case Constants.ELEMNAME_TEXT :
      case Constants.ELEMNAME_COPY :
      case Constants.ELEMNAME_VARIABLE :
      case Constants.ELEMNAME_MESSAGE :
  
        // instructions 
        // case Constants.ELEMNAME_PI:
        // case Constants.ELEMNAME_COMMENT:
        // case Constants.ELEMNAME_ELEMENT:
        // case Constants.ELEMNAME_ATTRIBUTE:
        break;
      default :
        error(XSLTErrorResources.ER_CANNOT_ADD,
              new Object[]{ newChild.getNodeName(),
                            this.getNodeName() });  //"Can not add " +((ElemTemplateElement)newChild).m_elemName +
  
      //" to " + this.m_elemName);
      }
  
      return super.appendChild(newChild);
    }
docs: Add a child to the child list.
  <!ELEMENT xsl:attribute %char-template;>
  <!ATTLIST xsl:attribute
  name %avt; #REQUIRED
  namespace %avt; #IMPLIED
  %space-att;
  >
  
  @param newChild Child to append to the list of this node's children
  
  @return The node we just appended to the children list
  
  @throws DOMException