public String getAttribute(Element element, String xmlname, XAttribute attr) {
   if (element == null || xmlname == null) return null;
   if (!element.hasAttribute(xmlname)) {
     String oldAttribute = xmlname;
     while (oldAttribute != null) {
       oldAttribute = oldAttributes.get(oldAttribute);
       if (oldAttribute != null && element.hasAttribute(oldAttribute)) {
         xmlname = oldAttribute;
         break;
       }
     }
   }
   return super.getAttribute(element, xmlname, attr);
 }