In your case only the first sentence applies. The rest of java doc talks about the general case, when the parameter's schema type can be a subtype of this.schemaType(), so the java instance has to change in order to have the right type, so the new one will be returned.
This dance is required because unlike in Schema, in java world once you have an instance you can't change its class. Cezar ________________________________ From: Hacking Bear [mailto:[EMAIL PROTECTED] Sent: Thursday, December 07, 2006 8:51 PM To: user@xmlbeans.apache.org Subject: Re: Outputing XML beans Hi Cezar, This way works and I will switch to this approach. I see now that's because RequestType represents the (complex content) type of the Request element. This is definitely hard to be grasped by beginner. By the way, the use of soapBody.set(XmlObject) is different from what the javadoc describes this method: <http://xmlbeans.apache.org/docs/2.2.0/reference/org/apache/xmlbeans/Xml Object.html> XmlObject <http://xmlbeans.apache.org/docs/2.2.0/reference/org/apache/xmlbeans/Xml Object.html> set(XmlObject <http://xmlbeans.apache.org/docs/2.2.0/reference/org/apache/xmlbeans/Xml Object.html> srcObj) Set the value/type of this XmlObject to be a copy of the source XmlObject. Because the type of the source may be different than this target, this XmlObject may become defunct. In this case the new XmlObject is returned. If no type change happens, the same this will be returned. If I understand this javadoc right, the soapBody ("this xmlObject") would become an (SAML) Request object or defunct, but the actual behavior is not that and is in fact more desirable (than the behavior described by its javadoc.) - HB On 12/7/06, Cezar Andrei <[EMAIL PROTECTED]> wrote: Mr. Bear, The misunderstanding comes from the fact that an XmlObject represents the content of an element, attribute or document, as opposed to a DOM node which contains the element/attribute itself (i.e. name + content). [... deleted ...] soapBody.set(doc); [... deleted ...] _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.