} else {
base.marshal(root, writer, context);
}
HypermediaResource resource = (HypermediaResource) root;
RelationBuilder builder = restfulie.newRelationBuilder();
resource.configureRelations(builder);
if( !builder.getRelations().isEmpty() ) {
ExtendedHierarchicalStreamWriterHelper.startNode(writer, "links", List.class);
Link link = null;
for (Relation t : builder.getRelations()) {
link = new Link(t.getName(), config.getApplicationPath() + t.getUri());
ExtendedHierarchicalStreamWriterHelper.startNode(writer, "link", String.class);
context.convertAnother(link);
writer.endNode();
}