Hi
I think you should be little bit more specific. What kind of situation you are facing?
As far as I know, there's no direct replacing method in API. Instead you can delete the old element (Document::Delete()) and create a new (Autodesk::Revit::Creation::Document).
What you can change on the fly is element type. See Element::ChangeTypeId().