Properties props = m.getProperties(); for (Enumeration keys = props.keys(); keys.hasMoreElements();) { String key = (String) keys.nextElement(); w.startElement("property"); w.writeAttribute("name", key); w.writeAttribute("value", props.getProperty(key)); w.endElement(); }
writeProperties(m.getProperties(), w);
    private static void writeObject(MapObject m, ObjectGroup o, XMLWriter w)        throws IOException    {        try {            Rectangle b = o.getBounds();            w.startElement("object");            w.writeAttribute("x", m.getX() + b.x);            w.writeAttribute("y", m.getY() + b.y);            w.writeAttribute("type", m.getType());            if (m.getSource() != null) {                w.writeAttribute("source", m.getSource());            }            Properties props = m.getProperties();            for (Enumeration keys = props.keys(); keys.hasMoreElements();) {                String key = (String) keys.nextElement();                w.startElement("property");                w.writeAttribute("name", key);                w.writeAttribute("value", props.getProperty(key));                w.endElement();            }            w.endElement();        } catch (XMLWriterException e) {            e.printStackTrace();        }    }