code: public static void writeAttributes(XMLStreamWriter xmlStreamWriter, HierarchicalProperty property)
        throws XMLStreamException
     {
        Map<String, String> attributes = property.getAttributes();
        Iterator<String> keyIter = attributes.keySet().iterator();
        while (keyIter.hasNext())
        {
           String attrName = keyIter.next();
           String attrValue = attributes.get(attrName);
           xmlStreamWriter.writeAttribute(attrName, attrValue);
        }
     }
docs: Writes property attributes into XML.
  
  @param xmlStreamWriter XML writer
  @param property property
  @throws XMLStreamException {@link XMLStreamException}