public Map<String, String> attributes() {
Node node = node();
if (node instanceof Element) {
Map<String, String> attrs = new HashMap<String, String>();
for (Iterator i = ((Element) node).attributeIterator(); i.hasNext();) {
Attribute a = (Attribute) i.next();
attrs.put(a.getName(), a.getValue());
}
return attrs;
}
return null;
}