Element rootElement = doc.createElementNS(ToolConstants.SCHEMA_URI, "schema");
rootElement.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns", ToolConstants.SCHEMA_URI);
rootElement.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:jaxb", ToolConstants.NS_JAXB_BINDINGS);
rootElement.setAttributeNS(ToolConstants.NS_JAXB_BINDINGS, "jaxb:version", "2.0");
rootElement.setAttributeNS(null, "targetNamespace", namespace);
Element annoElement = doc.createElementNS(ToolConstants.SCHEMA_URI, "annotation");
Element appInfo = doc.createElementNS(ToolConstants.SCHEMA_URI, "appinfo");
Element schemaBindings = doc.createElementNS(ToolConstants.NS_JAXB_BINDINGS, "jaxb:schemaBindings");
Element pkgElement = doc.createElementNS(ToolConstants.NS_JAXB_BINDINGS, "jaxb:package");
pkgElement.setAttributeNS(null, "name", pkgName);
annoElement.appendChild(appInfo);