I haven't looked at your Schema, but for optional elements/attributes, XMLBeans will generate unsetXXX() methods, which will remove the element/attribute rather than setting it to null. Radu
________________________________ From: Ritesh Shah [mailto:ritesh...@gmail.com] Sent: Wednesday, December 24, 2008 12:06 AM To: dev@xmlbeans.apache.org; xmlbeans-...@xml.apache.org Subject: How to delete a Child element in an XMLBeans application? How to delete a child element in Java beans style of handling XML document in an XMLBeans based Java application? I can't find way to deleting a child element using Java types created by XMLBeans based on the XML Schema. I know of doing it using XMLCursor interface. I have attached XML Schema SchemaDel.xsd, its input data InputDel.xml, and XMLBeans java application Delete_XmlBeans.java. This Java application logic wants to remove the "childElement1". However, output shows that childeElement1 is set to nil with xsi:nil="true". I was hoping for actual output to have "childElement1" disappeared completely. How can I do that? Thanks in advance. Ritesh