public void addAttribute (String attrName, String attrVal)
throws DocumentBuilderException {
XMLNode currentNode = peek ();
if (currentNode instanceof Element ||
currentNode instanceof ProcessingInstruction) {
Attribute attr = new Attribute (attrName);
attr.setValue (attrVal);
currentNode.addChild (attr);
} else {
throw new DocumentBuilderException (
"Attributes not allowed here.");
}