if (name != null) {
newResource.setName(name);
}
if (properties != null) {
for ( Map.Entry e : properties.entrySet()) {
Property prop = newResource.createChild(Property.class);
prop.setName((String)e.getKey());
prop.setValue((String)e.getValue());
newResource.getProperty().add(prop);
}
}