Changing XML Schema Dynamically

I need to insert and delete nodes from an XML Schema dynamically. I have achvied deleting nodes but after deleting I cant insert this new XML Schema into db. In my code
Element element = (Element) schemaXMlObject.getElement();
schemaXMlObject is the XMLObject for schema assume I deleted a node from element…My question how can i set this new element to schemaXMlObject again. I mean after changing the DOM element how can i set it to a XML Object


sounds like you are dealing with a problem regarding usage of a DOM-like API.
Which one do you use?

Standard DOM offers the following methods in class org.w3c.dom.Node:
insertBefore(Node, Node)

JDOM offers the following methods in class org.jdom.Element:
addContent(int, Content)

Hope this helps!