Source:
<code>public static String serialize(IBuildpathEntry[] entries, boolean isSystemLibrary, Map<String, String> attributes) throws IOException { ByteArrayOutputStream s = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(s, "UTF8"); XMLWriter xmlWriter = new XMLWriter(writer, null , true ); HashMap<String, String> library = new HashMap<String, String>(); library.put(TAG_VERSION, String.valueOf(CURRENT_VERSION)); library.put(TAG_SYSTEMLIBRARY, String.valueOf(isSystemLibrary)); if (attributes != null) { <START> library.putAll(attributes); <END> } xmlWriter.printTag(TAG_USERLIBRARY, library, true, true, false); for (int i = 0, length = entries.length; i < length; ++i) { BuildpathEntry cpEntry = (BuildpathEntry) entries[i]; HashMap<String, String> archive = new HashMap<String, String>(); archive.put(TAG_PATH, cpEntry.getPath().toString()); boolean hasExtraAttributes = cpEntry.extraAttributes != null && cpEntry.extraAttributes.length != 0; boolean hasRestrictions = cpEntry.getAccessRuleSet() != null; xmlWriter.printTag(TAG_ARCHIVE, archive, true, true, !(hasExtraAttributes || hasRestrictions)); if (hasExtraAttributes) { cpEntry.encodeExtraAttributes(xmlWriter, true, true); } if (hasRestrictions) { cpEntry.encodeAccessRules(xmlWriter, true, true); } if (hasExtraAttributes || hasRestrictions) { xmlWriter.endTag(TAG_ARCHIVE, true , true ); } } xmlWriter.endTag(TAG_USERLIBRARY, true , true ); writer.flush(); writer.close(); return s.toString("UTF8"); }</code><technical_language>question is: if attributes define names 2 predefined above? nested elements prefix for attribute names</technical_language>

Target:
public static String serialize(IBuildpathEntry[] entries, boolean isSystemLibrary, Map<String, String> attributes) throws IOException { ByteArrayOutputStream s = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(s, "UTF8"); XMLWriter xmlWriter = new XMLWriter(writer, null , true ); HashMap<String, String> library = new HashMap<String, String>(); library.put(TAG_VERSION, String.valueOf(CURRENT_VERSION)); library.put(TAG_SYSTEMLIBRARY, String.valueOf(isSystemLibrary)); if (attributes != null) { for (String key : attributes.keySet()) { library.put(ATTRIBUTE_PREFIX + key, attributes.get(key)); } } xmlWriter.printTag(TAG_USERLIBRARY, library, true, true, false); for (int i = 0, length = entries.length; i < length; ++i) { BuildpathEntry cpEntry = (BuildpathEntry) entries[i]; HashMap<String, String> archive = new HashMap<String, String>(); archive.put(TAG_PATH, cpEntry.getPath().toString()); boolean hasExtraAttributes = cpEntry.extraAttributes != null && cpEntry.extraAttributes.length != 0; boolean hasRestrictions = cpEntry.getAccessRuleSet() != null; xmlWriter.printTag(TAG_ARCHIVE, archive, true, true, !(hasExtraAttributes || hasRestrictions)); if (hasExtraAttributes) { cpEntry.encodeExtraAttributes(xmlWriter, true, true); } if (hasRestrictions) { cpEntry.encodeAccessRules(xmlWriter, true, true); } if (hasExtraAttributes || hasRestrictions) { xmlWriter.endTag(TAG_ARCHIVE, true , true ); } } xmlWriter.endTag(TAG_USERLIBRARY, true , true ); writer.flush(); writer.close(); return s.toString("UTF8"); }