code: @Override
      public void marshal(final Object object, final HierarchicalStreamWriter writer, final MarshallingContext context) {
          final CallDetailRecordList list = (CallDetailRecordList) object;
  
          writer.startNode("Calls");
          writer.addAttribute("page", String.valueOf(page));
          writer.addAttribute("numpages", String.valueOf(getTotalPages()));
          writer.addAttribute("pagesize", String.valueOf(pageSize));
          writer.addAttribute("total", String.valueOf(getTotalPages()));
          writer.addAttribute("start", getFirstIndex());
          writer.addAttribute("end", getLastIndex(list));
          writer.addAttribute("uri", pathUri);
          writer.addAttribute("firstpageuri", getFirstPageUri());
          writer.addAttribute("previouspageuri", getPreviousPageUri());
          writer.addAttribute("nextpageuri", getNextPageUri(list));
          writer.addAttribute("lastpageuri", getLastPageUri());
  
          for (final CallDetailRecord cdr : list.getCallDetailRecords()) {
              context.convertAnother(cdr);
          }
          writer.endNode();
      }
docs: Issue 110: https://bitbucket.org/telestax/telscale-restcomm/issue/110