<remark><p>Initial published version approved for publication by the XMPP Council.</p></remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2012-06-21</date>
<initials>snd</initials>
<remark><p>Root element name changed to "wrapper"; xmlns fixed in the XML-schema.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2012-06-13</date>
<initials>snd</initials>
<remark><p>Initial version.</p></remark>
</revision>
</header>
<section1topic='Introduction'anchor='intro'>
<p>In certain protocols that make use of &xep0004;, it can be helpful to include XML-data (for example, when we want to insert a big amount of structured data which is hard to insert as a separate fields). This document defines a method for including XML-data in a data form.</p>
</section1>
<section1topic='Media Element'anchor='media'>
<p>The root element for XML-data is <wrapper/>. This element MUST be qualified by the "urn:xmpp:xml-element" namespace. The <wrapper/> element MUST be contained within a <field/> element qualified by the 'jabber:x:data' namespace.</p>
<p>The <wrapper/> element SHOULD contain an XML-data which needs to be represented in a form.</p>
<examplecaption='PubSub Blog Node Metadata'><![CDATA[
<wrapperxmlns='urn:xmpp:xml-element'>
<feedxmlns='http://www.w3.org/2005/Atom'>
<title>Romeo&apos;s Microblog</title>
<id>tag:montague.lit,2008:home</id>
<updated>2008-05-08T18:30:02Z</updated>
<author>
<name>Romeo Montague</name>
<uri>xmpp:romeo@montague.lit</uri>
</author>
</feed>
</wrapper>
]]></example>
<examplecaption='Inclusion in Data Form'><![CDATA[
<xxmlns='jabber:x:data'type='form'>
[ ... ]
<fieldvar='xml-metadata'type='hidden'>
<wrapperxmlns='urn:xmpp:xml-element'>
<feedxmlns='http://www.w3.org/2005/Atom'>
<title>Romeo&apos;s Microblog</title>
<id>tag:montague.lit,2008:home</id>
<updated>2008-05-08T18:30:02Z</updated>
<author>
<name>Romeo Montague</name>
<uri>xmpp:romeo@montague.lit</uri>
</author>
</feed>
</wrapper>
</field>
[ ... ]
</x>
]]></example>
</section1>
<section1topic="Usage Practices">
<p>XML-data is usually hard for manual editing and SHOULD be used only for machine level iteractions. So it's RECOMMENDED to include it in the form as a "hidden" field.</p>
<p>However, there are situations when human editing of XML-data may be useful (for example, to see XML-logs of some XMPP-service). In that case it's RECOMMENDED for a client to represent this XML in a pretty formatted form and give an instruments to make it easier to edit XML-data.</p>