Sitecore has two kinds of item XML representation, or flavors if you will.
Serializer XML is the heavyweight format, containing everything Sitecore needs to know to get the item from one solution and paste into other: all attributes, field values in all versions and languages. It is used by the packager.
To get serializer xml programmatically:
item.GetOuterXml(deep);
XSLT XML is the internal interpretation that is fed to XSL renderings (tranformations). This is the lightweight brother, containing only item attributes and field ids. No field values, only the current version and language. You would want to know how it looks like if you code XSL renderings.
To get XSLT xml programmatically:
ItemNavigator navigator = Factory.CreateItemNavigator(rootItem);
writer.Write(navigator.OuterXml);
In the next (3.0.13, soon to be released) version of demo site, we have added the option to output item XML in both flavors to demonstrate what it feels like:
http://<demositeurl>/?xml= => Serializer XML flavor of the current item (no children)
http://<demositeurl>/?xml=&deep=true => Serializer XML flavor of the current item and all descendants
http://<demositeurl>/?xml=&xslt=true => XSLT XML flavor of the current item and all descendants (always 'deep')
Thanks to John West for the idea.