private static void writeChildren(Writer writer, BusinessCollection collection, int depth) {
        try{
            // Iterate children and write their data
            for(Object object : collection.getBusinessObjects()) {
                BusinessObject businessObject = (BusinessObject) object;
//                String objectName = businessObject.getName();
                // TODO: remove this to get more details in the parent file
                String objectType = businessObject.getBusinessObjectType();

                // Write the tag for the child e.g. <Accounting>
                for(int i=0;i<depth;i++) writer.write("  ");
                writer.write("  <"+objectType+">\n");

                // get the object's properties
                Properties objectProperties = businessObject.getOutputProperties();

                writer.write(writeNode(objectProperties, depth+1));

                // write the closing tag e.g. </Accounting>
                for(int i=0;i<depth;i++) writer.write("  ");
                writer.write("  </" + objectType + ">\n");
            }
        }catch (IOException io){
            io.printStackTrace();
        }
    }