TiXmlElement* GetFormalParamElement(Parameter *param) { TiXmlElement *fParamEl = new TiXmlElement("FPar"); Type *type = dynamic_cast<Type*>(param->type); TypeRef *tRef = dynamic_cast<TypeRef*>(param->type); if (tRef) type = static_cast<TypeSpec*>(tRef->type); string moduleName = type->GetModuleName(); if (!moduleName.empty()) fParamEl->SetAttribute("TypeQual", type->GetParentModule()->Name.c_str()); fParamEl->SetAttribute("Type", type->GetType().c_str()); fParamEl->SetAttribute("Name", param->Name.c_str()); return fParamEl; }