String (MavenDomDependency dependency) { StringBuilder res = new StringBuilder(); res.append("<dependency>\n"); res.append(" <groupId>").append(dependency.getGroupId().getStringValue()).append("</groupId>\n"); res.append(" <artifactId>").append(dependency.getArtifactId().getStringValue()).append("</artifactId>\n"); if (dependency.getType().getXmlElement() != null) { res.append(" <type>").append(dependency.getType().getStringValue()).append("</type>\n"); } if (dependency.getClassifier().getXmlElement() != null) { res.append(" <classifier>").append(dependency.getClassifier().getStringValue()).append("</classifier>\n"); } if (dependency.getScope().getXmlElement() != null) { res.append(" <scope>").append(dependency.getScope().getStringValue()).append("</scope>\n"); } if (dependency.getOptional().getXmlElement() != null) { res.append(" <optional>").append(dependency.getOptional().getStringValue()).append("</optional>\n"); } if (dependency.getVersion().getXmlElement() != null) { res.append(" <version>").append(dependency.getVersion().getStringValue()).append("</version>\n"); } res.append("</dependency>"); return StringUtil.escapeXmlEntities(res.toString()).replace(" ", "&nbsp;"); //NON-NLS }