Adding custom attributes to XML file

Hi

by using GenerateAttributes() function we can store node's attributes like location position,text etc in XML file
but is there any way to store custom attributes in XML file.
if i double click on any node and add some extra attributes or property then it should also get saved in XML file.
i tried adding attributes manually in XML file but when i overwite that file or if i add some extra nodes/links then XML file get rewritten so not able to restore that custom attributes.
can u plz suggest any solution?
thanks...

Why can’t you write extra attributes in your override of GenerateAttributes, and read those extra attributes in your override of ConsumeAttributes?

ya i tried with that solution but the problem is when i add new node whole XML file gets rewritten and that extra attributes values are comming from textbox so that gets saved for first time but when we add any node then fle gets rewitten so that values are not comming.