code: public void process(final Node aNode) {
  
          if (aNode instanceof Attr) {
  
              final Attr attribute = (Attr) aNode;
              final Element parentElement = attribute.getOwnerElement();
  
              if (isNamespaceDefinition(attribute)) {
  
                  // Use the incredibly smooth DOM way to rename an attribute...
                  parentElement.setAttributeNS(attribute.getNamespaceURI(), XMLNS + newPrefix, aNode.getNodeValue());
                  parentElement.removeAttribute(XMLNS + oldPrefix);
  
              } else if (isElementReference(attribute)
                      || isTypeAttributeWithPrefix(attribute)
                      || isExtension(attribute)) {
  
                  // Simply alter the value of the reference
                  final String value = attribute.getValue();
                  final String elementName = value.substring(value.indexOf(":") + 1);
                  attribute.setValue(newPrefix + ":" + elementName);
              }
          }
  
          if (oldPrefix.equals(aNode.getPrefix())) {
              // Simply change the prefix to the new one.
              aNode.setPrefix(newPrefix);
          }
      }
docs: {@inheritDoc}