code: private Attributes toAttributes(Map<String,String> attrs){
          AttributesImpl impl = new AttributesImpl();
          for (Map.Entry<String,String> attr : attrs.entrySet()){
          	impl.addAttribute("", attr.getKey(), "", "CDATA", attr.getValue());
          }
          return impl;
      }
docs: Converts attribute map to Attributes class instance.