static GF_Err DumpSceneReplace(GF_SceneDumper *sdump, GF_Command *com)
{
	if (sdump->XMLDump) {
		if (!sdump->X3DDump) {
			StartElement(sdump, "Replace");
			EndElementHeader(sdump, 1);
			sdump->indent++;
		}
		//scene tag is already dumped with X3D header
		if (!sdump->X3DDump) StartElement(sdump, "Scene");
		if (!sdump->X3DDump && com->use_names) {
			StartAttribute(sdump, "USENAMES");
			gf_fprintf(sdump->trace, "%s", com->use_names ? "true" : "false");
			EndAttribute(sdump);
		}
		if (!sdump->X3DDump) EndElementHeader(sdump, 1);
		sdump->indent++;
	} else {
		if (!sdump->skip_scene_replace) {
			DUMP_IND(sdump);
			gf_fprintf(sdump->trace, "REPLACE SCENE BY ");
		}
	}
	DumpProtos(sdump, com->new_proto_list);
	gf_dump_vrml_node(sdump, com->node, 0, NULL);
	if (!sdump->XMLDump) gf_fprintf(sdump->trace, "\n\n");

	if (com->aggregated) {
		u32 i, count;
		count = gf_list_count(com->node->sgprivate->scenegraph->Routes);
		for (i=0; i<count; i++) {
			GF_Route *r = (GF_Route *)gf_list_get(com->node->sgprivate->scenegraph->Routes, i);
			if (r->IS_route) continue;
			gf_dump_vrml_route(sdump, r, 0);
		}
	}

	return GF_OK;
}
static GF_Err DumpSceneReplace(GF_SceneDumper *sdump, GF_Command *com)
{
	if (sdump->XMLDump) {
		if (!sdump->X3DDump) {
			StartElement(sdump, "Replace");
			EndElementHeader(sdump, 1);
			sdump->indent++;
		}
		 
		if (!sdump->X3DDump) StartElement(sdump, "Scene");
		if (!sdump->X3DDump && com->use_names) {
			StartAttribute(sdump, "USENAMES");
			gf_fprintf(sdump->trace, "%s", com->use_names ? "true" : "false");
			EndAttribute(sdump);
		}
		if (!sdump->X3DDump) EndElementHeader(sdump, 1);
		sdump->indent++;
	} else {
		if (!sdump->skip_scene_replace) {
			DUMP_IND(sdump);
			gf_fprintf(sdump->trace, "REPLACE SCENE BY ");
		}
	}
	DumpProtos(sdump, com->new_proto_list);
	gf_dump_vrml_node(sdump, com->node, 0, NULL);
	if (!sdump->XMLDump) gf_fprintf(sdump->trace, "\n\n");

	if (com->aggregated) {
		u32 i, count;
		count = gf_list_count(com->node->sgprivate->scenegraph->Routes);
		for (i=0; i<count; i++) {
			GF_Route *r = (GF_Route *)gf_list_get(com->node->sgprivate->scenegraph->Routes, i);
			if (r->IS_route) continue;
			gf_dump_vrml_route(sdump, r, 0);
		}
	}

	return GF_OK;
}