final AttributesImpl attributes = new AttributesImpl();
attributes.addAttribute(XMLConstants.XSI_URI, "type", "xsi:type", "CDATA", type.getQualifiedName());
if (contentType != null)
attributes.addAttribute("", "content-type", "content-type", "CDATA", contentType);
if (lastModified != null)
<BUG>attributes.addAttribute("", "last-modified", "last-modified", "CDATA", ISODateUtils.getRFC1123Date(lastModified.longValue()));
output.startDocument();</BUG>
output.startPrefixMapping(XMLConstants.XSI_PREFIX, XMLConstants.XSI_URI);
output.startPrefixMapping(XMLConstants.XSD_PREFIX, XMLConstants.XSD_URI);
output.startElement("", documentElement, documentElement, attributes);

final AttributesImpl attributes = new AttributesImpl();
attributes.addAttribute(XMLConstants.XSI_URI, "type", "xsi:type", "CDATA", type.getQualifiedName());
if (contentType != null)
attributes.addAttribute("", "content-type", "content-type", "CDATA", contentType);
if (lastModified != null)
attributes.addAttribute("", "last-modified", "last-modified", "CDATA", ISODateUtils.getRFC1123Date(lastModified));
output.startDocument();
output.startPrefixMapping(XMLConstants.XSI_PREFIX, XMLConstants.XSI_URI);
output.startPrefixMapping(XMLConstants.XSD_PREFIX, XMLConstants.XSD_URI);
output.startElement("", documentElement, documentElement, attributes);
