You can specify the type xsd:any in a parent object to specify a child object, but only if the child object already exists.
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Parent"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="child" type="xsd:anyType"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
An exception will be thrown if the child data object does not exist.