type = obj.getClass();
}
if (genericType == null) {
genericType = type;
}
AegisContext context = getAegisContext(type, genericType);
AegisType aegisType = context.getTypeMapping().getType(genericType);
AegisWriter<XMLStreamWriter> aegisWriter = context.createXMLStreamWriter();
try {
W3CDOMStreamWriter w3cStreamWriter = new W3CDOMStreamWriter();
XMLStreamWriter spyingWriter = new PrefixCollectingXMLStreamWriter(w3cStreamWriter,
namespaceMap);
spyingWriter.writeStartDocument();