The xml variable (org.w3c.doc.Document) is a native xml data type. That means you can use xml functions and/or xPath expressions on the content of the variable.
The document variable (com.adobe.idp.Document) is a more generic data type that can store any binary data. If you happen to store xml in that data type, you won't be able to run xml functions or xPath expression directly on the variable content since it's treated as binary data.
If you don't need to manipulate or access the content of the xml, then either data types will work. Otherwise, I would use the xml data type.
In your component xml, make sure your xml data type is set to org.w3c.doc.Document and you'll see xml in Workbench.
This is a great explanation. Unfortunately using "org.w3c.doc.Document" in the component.xml results in the suggested data types in the input/output sections (when using variable) showing as "Document". Does this matter? Will I end up with issues when passing this variable to other components which require "document"?
How about "xml" what do I need to put in the component.xml for that one?
Yes. I though it would be showing xml for the variable type but it does show Document in both cases. But they are different. One is a org.w3c.dom.Document and the other one is a com.adobe.idp.Document.
So I guess try to use a title for that parameter that reflects the nature of the variable you're trying to use.
Also you can use the <hint> tag to put a bit more explanation on the variable type you want people to use.
Sounds good, thank you. Then I'll assume the "xml" type is some internal mapping from workbench that just maps
to the same thing as org.w3c.dom.Document.
That's a good assumption.