Initial contribution
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e2e928a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/target/
+/jaxb-api/target/
+/jaxb-api-test/target/
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..1aa2c2b
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,43 @@
+# Contributing to Eclipse Project for JAXB
+
+Thanks for your interest in this project.
+
+## Project description
+
+The Java??? Architecture for XML Binding (JAXB) provides an API and tools that
+automate the mapping between XML documents and Java objects.
+
+* https://projects.eclipse.org/projects/ee4j.jaxb
+
+## Developer resources
+
+Information regarding source code management, builds, coding standards, and
+more.
+
+* https://projects.eclipse.org/projects/ee4j.jaxb/developer
+
+The project maintains the following source code repositories
+
+* https://github.com/eclipse-ee4j/jaxb-api
+
+## Eclipse Contributor Agreement
+
+Before your contribution can be accepted by the project team contributors must
+electronically sign the Eclipse Contributor Agreement (ECA).
+
+* http://www.eclipse.org/legal/ECA.php
+
+Commits that are provided by non-committers must have a Signed-off-by field in
+the footer indicating that the author is aware of the terms by which the
+contribution has been provided to the project. The non-committer must
+additionally have an Eclipse Foundation account and must have a signed Eclipse
+Contributor Agreement (ECA) on file.
+
+For more information, please see the Eclipse Committer Handbook:
+https://www.eclipse.org/projects/handbook/#resources-commit
+
+## Contact
+
+Contact the project developers via the project's "dev" list.
+
+* https://accounts.eclipse.org/mailing-list/jaxb-dev
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..c739f78
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,29 @@
+
+    Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
+   
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+   
+      - Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.
+   
+      - Redistributions in binary form must reproduce the above copyright
+        notice, this list of conditions and the following disclaimer in the
+        documentation and/or other materials provided with the distribution.
+   
+      - Neither the name of the Eclipse Foundation, Inc. nor the names of its
+        contributors may be used to endorse or promote products derived
+        from this software without specific prior written permission.
+   
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c38da72
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+# Java Architecture for XML Binding (JAXB) API
+
+This project contains JAXB API based on JSR-222 specification.
+
+### Licensing and Governance
+
+JAXB API is licensed under a license - [EDL 1.0](LICENSE.md).
+
+### More Info
+
+JSR-222 specification documents are available on [jcp.org](https://jcp.org/en/jsr/detail?id=222).
diff --git a/bindingschema.xsd b/bindingschema.xsd
new file mode 100644
index 0000000..4275c8a
--- /dev/null
+++ b/bindingschema.xsd
@@ -0,0 +1,441 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<!--
+
+    Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Distribution License v. 1.0, which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: BSD-3-Clause
+
+-->
+
+<xs:schema
+   targetNamespace = "http://java.sun.com/xml/ns/jaxb"
+   xmlns:jaxb = "http://java.sun.com/xml/ns/jaxb"
+   xmlns:xs = "http://www.w3.org/2001/XMLSchema"
+   elementFormDefault = "qualified"
+   attributeFormDefault = "unqualified">
+  <xs:annotation>
+    <xs:documentation>Schema for binding schema.  JAXB Version 1.0</xs:documentation>
+  </xs:annotation>
+
+  <xs:group name = "declaration">
+    <xs:annotation>
+      <xs:documentation>
+        Model group that represents a binding declaration.
+        Each new binding declaration added to the jaxb namespace
+        that is not restricted to globalBindings should
+        be added as a child element to this model group.
+      </xs:documentation>
+      <xs:documentation>
+        Allow for extension binding declarations.
+      </xs:documentation>
+    </xs:annotation>
+    <!-- each new binding declaration, not restricted to
+           globalBindings, should be added here -->
+    <xs:choice>
+      <xs:element ref = "jaxb:globalBindings"/>
+      <xs:element ref = "jaxb:schemaBindings"/>
+      <xs:element ref = "jaxb:class"/>
+      <xs:element ref = "jaxb:property"/>
+      <xs:element ref = "jaxb:typesafeEnumClass"/>
+      <xs:element ref = "jaxb:typesafeEnumMember"/>
+      <xs:element ref = "jaxb:javaType"/>
+      <xs:element ref = "jaxb:inlineBinaryData"/>
+      <xs:element ref = "jaxb:factoryMethod"/>
+      <xs:any namespace = "##other" processContents = "lax"/>
+    </xs:choice>
+  </xs:group>
+
+  <xs:attribute name = "version" type="xs:token" >
+    <xs:annotation><xs:documentation>
+       Used to specify the version of the binding schema on the
+       schema element for inline annotations or jaxb:bindings
+       for external binding.
+    </xs:documentation></xs:annotation>
+  </xs:attribute>
+
+  <xs:attributeGroup name = "propertyAttributes">
+    <xs:annotation>
+      <xs:documentation>Attributes used for property customization. The attribute group
+        can be referenced either from the globalBindings declaration or from the 
+        property declaration. 
+        The following defaults are defined by the JAXB specification in global
+        scope only. Thus they apply when the propertyAttributes group is referenced
+        from the globalBindings declaration but not when referenced from the
+        property declaration.
+          collectionType            a class that implements java.util.List, or 'indexed'
+          fixedAttributeAsConstantProperty  false
+          enableFailFastCheck        false
+          generateIsSetMethod        false
+      </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name = "collectionType" type="jaxb:referenceCollectionType"/>
+    <xs:attribute name = "fixedAttributeAsConstantProperty" type = "xs:boolean"/>
+    <xs:attribute name = "enableFailFastCheck" type = "xs:boolean"/>
+    <xs:attribute name = "generateIsSetMethod" type = "xs:boolean"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name = "XMLNameToJavaIdMappingDefaults">
+    <xs:annotation>
+      <xs:documentation>Customize XMlNames to Java id mapping </xs:documentation>
+    </xs:annotation>
+    <xs:attribute name = "underscoreBinding" default = "asWordSeparator" type = "jaxb:underscoreBindingType"/>
+    <xs:attribute name = "typesafeEnumMemberName" default = "generateError" type = "jaxb:typesafeEnumMemberNameType"/>
+  </xs:attributeGroup>
+
+  <xs:attributeGroup name = "typesafeEnumClassDefaults">
+    <xs:attribute name = "typesafeEnumBase" default = "xs:NCname" type = "jaxb:typesafeEnumBaseType"/>
+  </xs:attributeGroup>
+
+  <xs:element name = "globalBindings">
+    <xs:annotation>
+      <xs:documentation>Customization values defined in global scope.</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence minOccurs = "0">
+        <xs:element ref = "jaxb:javaType" minOccurs = "0" maxOccurs = "unbounded"/>
+        <xs:any namespace = "##other" processContents = "lax" maxOccurs = "unbounded">
+          <xs:annotation> <xs:documentation>
+            allows extension binding declarations to be specified.
+        </xs:documentation></xs:annotation>
+        </xs:any>
+      </xs:sequence>
+      <xs:attributeGroup ref = "jaxb:XMLNameToJavaIdMappingDefaults"/>
+      <xs:attributeGroup ref = "jaxb:typesafeEnumClassDefaults"/>
+      <xs:attributeGroup ref = "jaxb:propertyAttributes"/>
+      <xs:attribute name = "enableJavaNamingConventions" default = "true" type = "xs:boolean"/>
+      <xs:attribute name = "bindingStyle" default = "elementBinding" type = "jaxb:bindingStyleType"/>
+      <xs:attribute name = "choiceContentProperty" default = "false" type = "xs:boolean"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name = "schemaBindings">
+    <xs:annotation>
+      <xs:documentation>Customization values with schema scope</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:all>
+        <xs:element name = "package" type = "jaxb:packageType" minOccurs = "0"/>
+        <xs:element name = "nameXmlTransform" type = "jaxb:nameXmlTransformType" minOccurs = "0"/>
+      </xs:all>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name = "class">
+    <xs:annotation>
+      <xs:documentation>Customize interface and implementation class.</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name = "javadoc" type = "xs:string" minOccurs = "0"/>
+      </xs:sequence>
+      <xs:attribute name = "name" type = "jaxb:javaIdentifierType">
+        <xs:annotation>
+          <xs:documentation>Java class name without package prefix.</xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name = "implClass" type = "jaxb:javaIdentifierType">
+        <xs:annotation>
+          <xs:documentation>Implementation class name including package prefix.  </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name = "property">
+    <xs:annotation>
+      <xs:documentation>Customize property.</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:all>
+        <xs:element name = "javadoc" type = "xs:string" minOccurs="0"/>
+        <xs:element name = "baseType" type="jaxb:propertyBaseType" minOccurs="0"/>
+      </xs:all>
+      <xs:attribute name = "name" type = "jaxb:javaIdentifierType"/>
+      <xs:attributeGroup ref = "jaxb:propertyAttributes"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name = "javaType">
+    <xs:annotation>
+      <xs:documentation>Data type conversions;  overriding builtins</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name = "name" use = "required" type = "jaxb:javaIdentifierType">
+        <xs:annotation>
+          <xs:documentation>name of the java type to which xml type is to be bound.</xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name = "xmlType" type = "xs:QName">
+        <xs:annotation>
+          <xs:documentation>
+            xml type to which java datatype has to be bound.
+            Must be present when javaType is scoped to globalBindings
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name = "parseMethod" type = "jaxb:javaIdentifierType"/>
+      <xs:attribute name = "printMethod" type = "jaxb:javaIdentifierType"/>
+      <xs:attribute name = "hasNsContext" default = "false" type = "xs:boolean" >
+        <xs:annotation>
+          <xs:documentation>
+            If true, the parsMethod and printMethod must reference a method
+            signtature that has a second parameter of type NamespaceContext.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name = "typesafeEnumClass">
+    <xs:annotation>
+      <xs:documentation>Bind to a type safe enumeration class.</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name = "javadoc" type = "xs:string" minOccurs = "0"/>
+        <xs:element ref = "jaxb:typesafeEnumMember" minOccurs = "0" maxOccurs = "unbounded"/>
+      </xs:sequence>
+      <xs:attribute name = "name" type = "jaxb:javaIdentifierType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name = "typesafeEnumMember">
+    <xs:annotation>
+      <xs:documentation> Enumeration member name in a type safe enumeration class.</xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name = "javadoc" type = "xs:string" minOccurs = "0"/>
+      </xs:sequence>
+      <xs:attribute name = "value" type="xs:anySimpleType"/>
+      <xs:attribute name = "name" use = "required" type = "jaxb:javaIdentifierType"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="inlineBinaryData">
+    <xs:annotation><xs:documentation><![CDATA[
+      Disable binary optimization.
+
+      Used on elements like <xs:element name="foo" type="xs:base64Binary"/> to indicate
+      that this base64 binary data is always inlined and never subjected to the binary
+      transfer optimization (such as XOP/MTOM)
+    ]]></xs:documentation></xs:annotation>
+    <xs:complexType />
+  </xs:element>
+
+  <xs:element name="factoryMethod">
+    <xs:annotation><xs:documentation><![CDATA[
+      Controls the name of the factory method on ObjectFactory.
+    ]]></xs:documentation></xs:annotation>
+    <xs:complexType>
+      <xs:sequence />
+      <xs:attribute name="name" type="xs:string" use="required" />
+    </xs:complexType>
+  </xs:element>
+  
+  <!-- TYPE DEFINITIONS -->
+
+  <xs:complexType name = "propertyBaseType">
+    <xs:annotation>
+      <xs:documentation>
+        Customize the base type of a property. For V1.0, only
+        javaType is allowed for customization of simple types
+        at point of reference to a simple type.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element ref = "jaxb:javaType" minOccurs = "0"/>
+    </xs:all>
+  </xs:complexType>
+
+  <xs:simpleType name = "bindingStyleType">
+    <xs:annotation>
+      <xs:documentation>Allows selection of a binding algorithm</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base = "xs:string">
+      <xs:enumeration value = "elementBinding"/>
+      <xs:enumeration value = "modelGroupBinding"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:complexType name = "packageType">
+    <xs:sequence>
+      <xs:element name = "javadoc" type = "xs:string" minOccurs = "0"/>
+    </xs:sequence>
+    <xs:attribute name = "name" type = "jaxb:javaIdentifierType"/>
+  </xs:complexType>
+  <xs:simpleType name = "underscoreBindingType">
+    <xs:annotation>
+      <xs:documentation>Treate underscore  in XML Name to Java identifier mapping.  </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base = "xs:string">
+      <xs:enumeration value = "asWordSeparator"/>
+      <xs:enumeration value = "asCharInWord"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name = "typesafeEnumBaseType">
+    <xs:annotation>
+      <xs:documentation>
+        XML types or types derived from them which have enumeration facet(s) which
+        are be mapped to typesafeEnumClass by default.
+        The following types cannot be specified in this list:
+        "xsd:QName", "xsd:base64Binary", "xsd:hexBinary",
+        "xsd:date", "xsd:time", "xsd:dateTime", "xsd:duration",
+        "xsd:gDay", "xsd:gMonth", "xsd:Year", "xsd:gMonthDay", "xsd:YearMonth"
+      </xs:documentation>
+    </xs:annotation>
+    <xs:list itemType = "xs:QName"/>
+  </xs:simpleType>
+  <xs:simpleType name = "typesafeEnumMemberNameType">
+    <xs:annotation>
+      <xs:documentation>
+        Used to customize how to handle name collisions.
+
+        i.  generate VALUE_1, VALUE_2... if  generateName.
+        ii.  generate an error  if value is generateError. This is JAXB default behavior.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base = "xs:string">
+      <xs:enumeration value = "generateName"/>
+      <xs:enumeration value = "generateError"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:simpleType name = "javaIdentifierType">
+    <xs:annotation>
+      <xs:documentation>Placeholder type to indicate Legal Java identifier.</xs:documentation>
+    </xs:annotation>
+    <xs:list itemType = "xs:NCName"/>
+  </xs:simpleType>
+  <xs:complexType name = "nameXmlTransformRule">
+    <xs:annotation>
+      <xs:documentation>Rule to transform an Xml name into another Xml name</xs:documentation>
+    </xs:annotation>
+    <xs:attribute name = "prefix" type = "xs:string">
+      <xs:annotation>
+        <xs:documentation>prepend the string to QName.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name = "suffix" type = "xs:string">
+      <xs:annotation>
+        <xs:documentation>Append the string to QName.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+  </xs:complexType>
+  <xs:complexType name = "nameXmlTransformType">
+    <xs:annotation>
+      <xs:documentation>
+        Allows transforming an xml name into another xml name. Use case UDDI 2.0 schema.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:all>
+      <xs:element name = "typeName" type = "jaxb:nameXmlTransformRule" minOccurs = "0">
+        <xs:annotation>
+          <xs:documentation>Mapping rule for type definitions.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name = "elementName" type = "jaxb:nameXmlTransformRule" minOccurs = "0">
+        <xs:annotation>
+          <xs:documentation>Mapping rule for elements</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name = "modelGroupName" type = "jaxb:nameXmlTransformRule" minOccurs = "0">
+        <xs:annotation>
+          <xs:documentation>Mapping rule  for model group</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name = "anonymousTypeName" type = "jaxb:nameXmlTransformRule" minOccurs = "0">
+        <xs:annotation>
+          <xs:documentation>Mapping rule for class names generated for an anonymous type.</xs:documentation>
+        </xs:annotation>
+      </xs:element>
+    </xs:all>
+  </xs:complexType>
+  <xs:attribute name = "extensionBindingPrefixes">
+    <xs:annotation>
+      <xs:documentation>
+        A binding compiler only processes this attribute when it occurs on an
+        an instance of xs:schema element.  The value of this attribute is a
+        whitespace-separated list of namespace prefixes.  The namespace bound
+        to each of the prefixes is designated as a customization declaration
+        namespace.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:simpleType>
+      <xs:list itemType = "xs:normalizedString"/>
+    </xs:simpleType>
+  </xs:attribute>
+  <xs:element name = "bindings">
+    <xs:annotation>
+      <xs:documentation>
+        Binding declaration(s) for a remote schema.
+        If attribute node is set, the binding declaraions
+        are associated with part of the remote schema
+        designated by schemaLocation attribute. The node
+        attribute identifies the node in the remote schema
+        to associate the binding declaration(s) with.
+      </xs:documentation>
+    </xs:annotation>
+    <!-- a <bindings> element can contain arbitrary number of binding declarations or nested <bindings> elements -->
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs = "0" maxOccurs = "unbounded">
+          <xs:group ref = "jaxb:declaration"/>
+          <xs:element ref = "jaxb:bindings"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name = "schemaLocation" type = "xs:anyURI">
+        <xs:annotation>
+          <xs:documentation>
+            Location of the remote schema to associate binding declarations with.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name = "node" type = "xs:string">
+        <xs:annotation>
+          <xs:documentation>
+            The value of the string is an XPATH 1.0 compliant string that
+            resolves to a node in a remote schema to associate
+            binding declarations with. The remote schema is specified
+            by the schemaLocation attribute occuring in the current
+            element or in a parent of this element.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute name = "version" type = "xs:token">
+        <xs:annotation>
+          <xs:documentation>
+             Used to indicate the version of binding declarations.
+             Only valid on root level bindings element.
+             Either this or "jaxb:version" attribute but not both may be specified.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+      <xs:attribute ref = "jaxb:version">
+        <xs:annotation>
+          <xs:documentation>
+             Used to indicate the version of binding declarations.
+             Only valid on root level bindings element.
+             Either this attribute or "version" attribute but not both may be specified.
+          </xs:documentation>
+        </xs:annotation>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:simpleType name="referenceCollectionType">
+    <xs:union>
+      <xs:simpleType>
+        <xs:restriction base="xs:string">
+          <xs:enumeration value="indexed"/>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:simpleType>
+        <xs:restriction base="jaxb:javaIdentifierType"/>
+      </xs:simpleType>
+    </xs:union>
+  </xs:simpleType>
+</xs:schema>
+
diff --git a/etc/config/copyright-exclude b/etc/config/copyright-exclude
new file mode 100644
index 0000000..f1bb560
--- /dev/null
+++ b/etc/config/copyright-exclude
@@ -0,0 +1,37 @@
+.gif
+.jpg
+.jpeg
+.jpeg1
+.jpeg2
+.png
+.svg
+.tif
+.exe
+.ico
+.jar
+.zip
+.war
+.sql
+.jks
+.json
+.class
+.bin
+.iml
+.ipr
+.envelope
+.txt
+.bat
+.sh
+.commented
+.svnignore
+.svn
+/.auth
+www
+site
+etc/config/copyright-exclude
+jaxb-api-test/src/test/resources/logging.properties
+jaxb-api-test/src/test/resources/javax/xml/bind/test.policy
+jaxb-api-test/src/test/resources/jaxb/test/usr/jaxb.index
+/LICENSE.md
+/README.md
+/CONTRIBUTING.md
diff --git a/etc/config/edl-copyright.txt b/etc/config/edl-copyright.txt
new file mode 100644
index 0000000..1858057
--- /dev/null
+++ b/etc/config/edl-copyright.txt
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) YYYY Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ * 
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
diff --git a/exclude.xml b/exclude.xml
new file mode 100644
index 0000000..4a00c67
--- /dev/null
+++ b/exclude.xml
@@ -0,0 +1,41 @@
+<!--
+
+    Copyright (c) 2013, 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Distribution License v. 1.0, which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: BSD-3-Clause
+
+-->
+
+<FindBugsFilter>
+
+    <!--
+    As designed.
+    -->
+    <Match>
+        <Class name="javax.xml.bind.util.JAXBSource$1"/>
+        <Bug pattern="XFB_XML_FACTORY_BYPASS"/>
+    </Match>
+
+    <!--
+    TODO: reevaluate for MR
+    As designed, impossible to change, maybe with MR.
+    -->
+    <Match>
+        <Class name="javax.xml.bind.DatatypeConverterImpl"/>
+        <Bug pattern="NP_BOOLEAN_RETURN_NULL"/>
+    </Match>
+
+    <!--
+    TODO: reevaluate for MR
+    As designed, impossible to change, maybe with MR?
+    -->
+    <Match>
+        <Class name="javax.xml.bind.annotation.adapters.HexBinaryAdapter"/>
+        <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+    </Match>
+
+</FindBugsFilter>
diff --git a/jaxb-api-test/pom.xml b/jaxb-api-test/pom.xml
new file mode 100644
index 0000000..1c22484
--- /dev/null
+++ b/jaxb-api-test/pom.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Distribution License v. 1.0, which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: BSD-3-Clause
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>jaxb-api-parent</artifactId>
+        <groupId>javax.xml.bind</groupId>
+        <version>2.3.2-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jaxb-api-test</artifactId>
+    <packaging>jar</packaging>
+
+    <properties>
+        <config.dir>${project.basedir}/../etc/config</config.dir>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>javax.activation-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <release>9</release>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy</id>
+                        <phase>test-compile</phase>
+                        <goals>
+                            <goal>copy</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>javax.xml.bind</groupId>
+                                    <artifactId>jaxb-api</artifactId>
+                                    <version>${project.version}</version>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>${project.build.directory}/mods</outputDirectory>
+                                </artifactItem>
+                                <artifactItem>
+                                    <groupId>javax.activation</groupId>
+                                    <artifactId>javax.activation-api</artifactId>
+                                    <version>${activation.version}</version>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>${project.build.directory}/mods</outputDirectory>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <argLine>
+                        --add-modules java.xml.bind
+                        --upgrade-module-path ${project.build.directory}/mods/jaxb-api-${project.version}.jar
+                        --module-path ${project.build.directory}/mods/javax.activation-api-${activation.version}.jar
+                        --add-reads java.xml.bind=ALL-UNNAMED
+                    </argLine>
+                    <systemPropertyVariables>
+                        <java.util.logging.config.file>
+                            src/test/resources/logging.properties
+                        </java.util.logging.config.file>
+                    </systemPropertyVariables>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/jaxb-api-test/src/main/java/module-info.java b/jaxb-api-test/src/main/java/module-info.java
new file mode 100644
index 0000000..91f7b96
--- /dev/null
+++ b/jaxb-api-test/src/main/java/module-info.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * Placeholder for
+ */
+module java.xml.bind.tests.src {}
diff --git a/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextServiceProviderNPETest.java b/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextServiceProviderNPETest.java
new file mode 100644
index 0000000..8538000
--- /dev/null
+++ b/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextServiceProviderNPETest.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.test;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.xml.bind.*;
+import java.util.Map;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.TestCase.fail;
+
+/**
+ * regression test for
+ * JDK-8145104: NPE is thrown when JAXBContextFactory implementation is specified in system property
+ */
+public class JAXBContextServiceProviderNPETest {
+
+    public static class Factory implements JAXBContextFactory {
+
+        @Override
+        public JAXBContext createContext(Class<?>[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
+            return new MyContext();
+        }
+
+        @Override
+        public JAXBContext createContext(String contextPath, ClassLoader classLoader, Map<String, ?> properties)
+                throws JAXBException {
+            return new MyContext();
+        }
+    }
+
+    static class MyContext extends JAXBContext {
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+
+    @Test
+    public void testContextPath() {
+        try {
+            JAXBContext ctx = JAXBContext.newInstance("whatever", ClassLoader.getSystemClassLoader());
+            assertNotNull("Expected non-null instance to be returned from the test Factory", ctx);
+            assertEquals("Expected MyContext instance to be returned from the test Factory", MyContext.class, ctx.getClass());
+        } catch (Throwable t) {
+            t.printStackTrace();
+            fail("Not expected to fail!");
+        }
+    }
+
+    @Test
+    public void testClasses() {
+        try {
+            JAXBContext ctx = JAXBContext.newInstance(new Class[0]);
+            assertNotNull("Expected non-null instance to be returned from the test Factory", ctx);
+            assertEquals("Expected MyContext instance to be returned from the test Factory", MyContext.class, ctx.getClass());
+        } catch (Throwable t) {
+            t.printStackTrace();
+            fail("Not expected to fail!");
+        }
+    }
+
+    @Before
+    public void setup() {
+        System.setProperty("javax.xml.bind.JAXBContextFactory", "javax.xml.bind.test.JAXBContextServiceProviderNPETest$Factory");
+    }
+
+    public static void main(String[] args) throws JAXBException {
+        JAXBContextServiceProviderNPETest tst = new JAXBContextServiceProviderNPETest();
+        tst.setup();
+        tst.testContextPath();
+        tst.testClasses();
+    }
+
+}
diff --git a/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextTest.java b/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextTest.java
new file mode 100644
index 0000000..4d134f6
--- /dev/null
+++ b/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextTest.java
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.test;
+
+
+import jaxb.test.usr.A;
+import junit.framework.AssertionFailedError;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import javax.xml.bind.JAXBContext;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import static junit.framework.TestCase.assertTrue;
+
+/*
+ * test for JDK-8131334: SAAJ Plugability Layer: using java.util.ServiceLoader
+ *
+ * There are unsafe scenarios not to be run within the build (modifying jdk files).
+ * To run those, following needs to be done:
+ *   1. allow java to write into $JAVA_HOME/conf: mkdir $JAVA_HOME/conf; chmod a+rw $JAVA_HOME/conf
+ *   2. use "runUnsafe" property: mvn clean test -DrunUnsafe=true
+ */
+@RunWith(Parameterized.class)
+public class JAXBContextTest {
+
+    static final Logger logger = Logger.getLogger(JAXBContextTest.class.getName());
+
+    static final Boolean skipUnsafe = !Boolean.getBoolean("runUnsafe");
+
+    // test configuration ------------------------------------------
+
+    // test-classes directory (required for setup and for security settings)
+    static final String classesDir = JAXBContextTest.class.getProtectionDomain().getCodeSource().getLocation().getFile();
+    private static final String FACTORY_ID_LEGACY = "javax.xml.bind.context.factory";
+    private static final String FACTORY_ID = "javax.xml.bind.JAXBContextFactory";
+    private static final String PACKAGE_LEGACY = "jaxb.factory.legacy."; // TODO: ???
+    private static final String PACKAGE_SPI = "jaxb.factory.spi."; // TODO: ???
+    private static final Object DEFAULT = "com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl";
+
+
+    static {
+        System.setProperty("classesDir", classesDir);
+    }
+
+    // configuration to be created by the test
+    static Path providersDir = Paths.get(classesDir, "META-INF", "services");
+    static Path providersFileLegacy = providersDir.resolve("javax.xml.bind.JAXBContext");
+    static Path providersFile = providersDir.resolve("javax.xml.bind.JAXBContextFactory");
+
+    // configuration to be created by the test
+    static Path jaxbPropsDir = Paths.get(classesDir, "jaxb", "test", "usr");
+    static Path jaxbPropsFile = jaxbPropsDir.resolve("jaxb.properties");
+
+    // test instance -----------------------------------------------
+
+    // scenario name - just for logging
+    String scenario;
+
+    // java policy file for testing w/security manager
+    private String expectedFactory;
+    private Class<?> expectedException;
+
+
+    @Parameterized.Parameters
+    public static Collection configurations() {
+        return Arrays.asList(new Object[][]{
+                // scenario-name, jaxb.properties, svc, arg1, arg2, system-props
+                {"scenario-1", FACTORY_ID_LEGACY + "="+PACKAGE_LEGACY+"Valid", null, PACKAGE_LEGACY+"Valid$JAXBContext1", null, null},
+                {"scenario-3", FACTORY_ID_LEGACY + "=non.existing.FactoryClass", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-4", FACTORY_ID_LEGACY + "="+PACKAGE_LEGACY+"Invalid", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-13", FACTORY_ID_LEGACY + "="+PACKAGE_LEGACY+"Valid", PACKAGE_LEGACY+"Valid2", PACKAGE_LEGACY+"Valid$JAXBContext1", null, PACKAGE_LEGACY+"Valid3"},
+
+                {"scenario-1", FACTORY_ID_LEGACY + "="+PACKAGE_SPI+"Valid", null, PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+                {"scenario-3", FACTORY_ID_LEGACY + "=non.existing.FactoryClass", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-4", FACTORY_ID_LEGACY + "="+PACKAGE_SPI+"Invalid", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-13", FACTORY_ID_LEGACY + "="+PACKAGE_SPI+"Valid", PACKAGE_SPI+"Valid2", PACKAGE_SPI+"Valid$JAXBContext1", null, PACKAGE_SPI+"Valid3"},
+
+                {"scenario-1", FACTORY_ID + "="+PACKAGE_SPI+"Valid", null, PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+                {"scenario-3", FACTORY_ID + "=non.existing.FactoryClass", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-4", FACTORY_ID + "="+PACKAGE_SPI+"Invalid", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-13", FACTORY_ID + "="+PACKAGE_SPI+"Valid", PACKAGE_SPI+"Valid2", PACKAGE_SPI+"Valid$JAXBContext1", null, PACKAGE_SPI+"Valid3"},
+
+                {"scenario-1", FACTORY_ID + "="+PACKAGE_LEGACY+"Valid", null, PACKAGE_LEGACY+"Valid$JAXBContext1", null, null},
+                {"scenario-3", FACTORY_ID + "=non.existing.FactoryClass", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-4", FACTORY_ID + "="+PACKAGE_LEGACY+"Invalid", null, null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-13", FACTORY_ID + "="+PACKAGE_LEGACY+"Valid", PACKAGE_LEGACY+"Valid2", PACKAGE_LEGACY+"Valid$JAXBContext1", null, PACKAGE_LEGACY+"Valid3"},
+
+
+                {"scenario-2", "something=AnotherThing", null, null, javax.xml.bind.JAXBException.class, null},
+
+                // service loader
+                {"scenario-8", null, PACKAGE_SPI+"Valid\n", PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+                {"scenario-9", null, PACKAGE_SPI+"Valid", PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+                {"scenario-11", null, PACKAGE_SPI+"Invalid", null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-15", null, PACKAGE_SPI+"Valid", PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+
+                // service loader - legacy
+                {"scenario-8 legacy-svc", null, PACKAGE_SPI+"Valid\n", PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+                {"scenario-9 legacy-svc", null, PACKAGE_SPI+"Valid", PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+                {"scenario-11 legacy-svc", null, PACKAGE_SPI+"Invalid", null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-15 legacy-svc", null, PACKAGE_SPI+"Valid", PACKAGE_SPI+"Valid$JAXBContext1", null, null},
+
+                // service loader - legacy
+                {"scenario-8 legacy-svc", null, PACKAGE_LEGACY+"Valid\n", PACKAGE_LEGACY+"Valid$JAXBContext1", null, null},
+                {"scenario-9 legacy-svc", null, PACKAGE_LEGACY+"Valid", PACKAGE_LEGACY+"Valid$JAXBContext1", null, null},
+                {"scenario-11 legacy-svc", null, PACKAGE_LEGACY+"Invalid", null, javax.xml.bind.JAXBException.class, null},
+                {"scenario-15 legacy-svc", null, PACKAGE_LEGACY+"Valid", PACKAGE_LEGACY+"Valid$JAXBContext1", null, null},
+
+                // system property
+                {"scenario-5", null, null, PACKAGE_SPI+"Valid$JAXBContext1", null, PACKAGE_SPI+"Valid"},
+                {"scenario-7", null, null, null, javax.xml.bind.JAXBException.class, PACKAGE_SPI+"Invalid"},
+                {"scenario-14", null, PACKAGE_SPI+"Valid2", PACKAGE_SPI+"Valid$JAXBContext1", null, PACKAGE_SPI+"Valid"},
+
+                {"scenario-5", null, null, PACKAGE_LEGACY+"Valid$JAXBContext1", null, PACKAGE_LEGACY+"Valid"},
+                {"scenario-7", null, null, null, javax.xml.bind.JAXBException.class, PACKAGE_LEGACY+"Invalid"},
+                {"scenario-14", null, PACKAGE_LEGACY+"Valid2", PACKAGE_LEGACY+"Valid$JAXBContext1", null, PACKAGE_LEGACY+"Valid"},
+                {"scenario-6", null, null, null, javax.xml.bind.JAXBException.class, "jaxb.factory.NonExisting"},
+
+                {"scenario-10", null, "jaxb.factory.NonExisting", null, javax.xml.bind.JAXBException.class, null},
+
+                {"scenario-12", null, null, DEFAULT, javax.xml.bind.JAXBException.class, null},
+        });
+    }
+
+    // scenario-name, jaxb.properties, svc, arg1, arg2, system-props
+    public JAXBContextTest(
+            String scenario,
+            String jaxbPropertiesClass,
+            String spiClass,
+            String expectedFactory,
+            Class<?> expectedException,
+            String systemProperty
+    ) {
+
+        // ensure setup may be done ...
+        System.setSecurityManager(null);
+
+        if (systemProperty != null) {
+            System.setProperty("javax.xml.bind.JAXBContextFactory", systemProperty);
+        } else {
+            System.clearProperty("javax.xml.bind.JAXBContextFactory");
+        }
+
+        this.scenario = scenario;
+        this.expectedFactory = expectedFactory;
+        this.expectedException = expectedException;
+
+        if (skipUnsafe && scenario.startsWith("unsafe")) {
+            log("Skipping unsafe scenario:" + scenario);
+            return;
+        }
+
+        prepare(jaxbPropertiesClass, spiClass);
+    }
+
+    @Test
+    public void testPath() throws IOException {
+        logConfigurations();
+        try {
+            JAXBContext ctx = JAXBContext.newInstance("jaxb.test.usr");
+            handleResult(ctx);
+        } catch (Throwable throwable) {
+            handleThrowable(throwable);
+        } finally {
+            doFinally();
+        }
+    }
+
+    @Test
+    public void testClasses() throws IOException {
+        logConfigurations();
+        try {
+            JAXBContext ctx = JAXBContext.newInstance(new Class[] {A.class}, null);
+            handleResult(ctx);
+        } catch (Throwable throwable) {
+            handleThrowable(throwable);
+        } finally {
+            doFinally();
+        }
+    }
+
+    @Test
+    public void testClass() throws IOException {
+        logConfigurations();
+        try {
+            JAXBContext ctx = JAXBContext.newInstance(A.class);
+            handleResult(ctx);
+        } catch (Throwable throwable) {
+            handleThrowable(throwable);
+        } finally {
+            doFinally();
+        }
+    }
+
+    private void handleResult(JAXBContext ctx) {
+        assertTrue("No ctx found.", ctx != null);
+        log("     TEST: context class = [" + ctx.getClass().getName() + "]\n");
+        String className = ctx.getClass().getName();
+        assertTrue("Incorrect ctx: [" + className + "], Expected: [" + expectedFactory + "]",
+                className.equals(expectedFactory));
+
+        log(" TEST PASSED");
+    }
+
+    private void handleThrowable(Throwable throwable) {
+        if (throwable instanceof AssertionFailedError) throw ((AssertionFailedError)throwable);
+        Class<?> throwableClass = throwable.getClass();
+        boolean correctException = throwableClass.equals(expectedException);
+        if (!correctException) {
+            throwable.printStackTrace();
+        }
+        if (expectedException == null) {
+            throw new AssertionFailedError("Unexpected exception:" + throwableClass);
+        }
+        assertTrue("Got unexpected exception: [" + throwableClass + "], expected: [" + expectedException + "]",
+                correctException);
+        log(" TEST PASSED");
+    }
+
+    private void doFinally() {
+        cleanResource(providersFile);
+        //cleanResource(providersDir);
+
+        // unsafe; not running:
+        cleanResource(jaxbPropsFile);
+        System.setSecurityManager(null);
+    }
+
+    @Test
+    public void testPathSM() throws IOException {
+        enableSM();
+        testPath();
+    }
+
+    @Test
+    public void testClassSM() throws IOException {
+        enableSM();
+        testClass();
+    }
+
+    @Test
+    public void testClassesSM() throws IOException {
+        enableSM();
+        testClasses();
+    }
+
+
+    private void enableSM() {
+        System.setSecurityManager(null);
+        System.setProperty("java.security.policy", classesDir + "javax/xml/bind/test.policy");
+        System.setSecurityManager(new SecurityManager());
+    }
+
+    private void cleanResource(Path resource) {
+        try {
+            if (Files.exists(resource)) {
+                Files.deleteIfExists(resource);
+            }
+        } catch (IOException ignored) {
+            ignored.printStackTrace();
+        }
+    }
+
+    private void prepare(String propertiesClassName, String providerClassName) {
+
+        try {
+            log("providerClassName = " + providerClassName);
+            log("propertiesClassName = " + propertiesClassName);
+
+            cleanResource(providersFile);
+            cleanResource(providersFileLegacy);
+            if (scenario.contains("legacy-svc")) {
+                setupFile(providersFileLegacy, providersDir, providerClassName);
+            } else {
+                setupFile(providersFile, providersDir, providerClassName);
+            }
+
+
+            // unsafe; not running:
+            if (propertiesClassName != null) {
+                setupFile(jaxbPropsFile, jaxbPropsDir, propertiesClassName);
+            } else {
+                cleanResource(jaxbPropsFile);
+            }
+
+            log(" SETUP OK.");
+
+        } catch (IOException e) {
+            log(" SETUP FAILED.");
+            e.printStackTrace();
+        }
+    }
+
+    private void logConfigurations() throws IOException {
+        logFile(providersFile);
+        logFile(providersFileLegacy);
+        logFile(jaxbPropsFile);
+    }
+
+    private void logFile(Path path) throws IOException {
+        if (Files.exists(path)) {
+            log("File [" + path + "] exists: [");
+            log(new String(Files.readAllBytes(path)));
+            log("]");
+        }
+    }
+
+    private void setupFile(Path file, Path dir, String value) throws IOException {
+        cleanResource(file);
+        if (value != null) {
+            log("writing configuration [" + value + "] into file [" + file.toAbsolutePath() + "]");
+            Files.createDirectories(dir);
+            Files.write(
+                    file,
+                    value.getBytes(),
+                    StandardOpenOption.CREATE);
+        }
+    }
+
+    private void log(String msg) {
+        logger.info("[" + scenario + "] " + msg);
+//        System.out.println("[" + scenario + "] " + msg);
+    }
+
+}
+
diff --git a/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextWrapExceptionTest.java b/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextWrapExceptionTest.java
new file mode 100644
index 0000000..56c31d1
--- /dev/null
+++ b/jaxb-api-test/src/test/java/javax/xml/bind/test/JAXBContextWrapExceptionTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.test;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import java.util.Map;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.TestCase.assertNull;
+
+/**
+ * regression test for
+ * JDK-8145112: newInstance(String, ClassLoader): java.lang.JAXBException should not be wrapped as expected
+ * according to spec
+ */
+public class JAXBContextWrapExceptionTest {
+
+    public static class Factory {
+
+        public static JAXBContext createContext(Class[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
+            throw new JAXBException("test");
+        }
+
+        public static JAXBContext createContext(String contextPath, ClassLoader classLoader, Map<String, ?> properties)
+                throws JAXBException {
+            throw new JAXBException("test");
+        }
+    }
+
+    @Test
+    public void testContextPath() {
+        try {
+            JAXBContext.newInstance("whatever", ClassLoader.getSystemClassLoader());
+        } catch (Throwable t) {
+            assertEquals("test", t.getMessage());
+            assertNull("Root cause must be null", t.getCause());
+        }
+    }
+
+    @Test
+    public void testClasses() {
+        try {
+            JAXBContext.newInstance(new Class[0]);
+            assertTrue("This should fail", false);
+        } catch (Throwable t) {
+            assertEquals("test", t.getMessage());
+            assertNull("Root cause must be null", t.getCause());
+        }
+    }
+
+    @Before
+    public void setup() {
+        System.setProperty("javax.xml.bind.JAXBContextFactory", "javax.xml.bind.test.JAXBContextWrapExceptionTest$Factory");
+    }
+
+    public static void main(String[] args) throws JAXBException {
+        new JAXBContextWrapExceptionTest().testContextPath();
+        new JAXBContextWrapExceptionTest().testClasses();
+    }
+
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/legacy/Invalid.java b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Invalid.java
new file mode 100644
index 0000000..38148c9
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Invalid.java
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.legacy;
+
+/**
+ * Invalid JAXBContext factory class for tests
+ * - doesn't contain required static methods
+ */
+public class Invalid {
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid.java b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid.java
new file mode 100644
index 0000000..b23b589
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.legacy;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Validator;
+import java.util.Map;
+
+/**
+ * Valid JAXBContext factory class for tests
+ * - contains required static methods and creates dummy JAXBContext
+ */
+public class Valid {
+
+    public static JAXBContext createContext(java.lang.String path, java.lang.ClassLoader cl) {
+        return new JAXBContext1();
+    }
+
+    public static JAXBContext createContext(Class[] classes, Map<String, Object> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+
+    public static class JAXBContext1 extends JAXBContext {
+
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid2.java b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid2.java
new file mode 100644
index 0000000..56ce990
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid2.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.legacy;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Validator;
+import java.util.Map;
+
+/**
+ * (Another) Valid JAXBContext factory class for tests
+ * - contains required static methods and creates dummy JAXBContext
+ * - several implementations necessary to test different configuration approaches
+ */
+public class Valid2 {
+
+    public static JAXBContext createContext(String path, ClassLoader cl) {
+        return new JAXBContext1();
+    }
+
+    public static JAXBContext createContext(Class[] classes, Map<String, Object> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+
+    public static class JAXBContext1 extends JAXBContext {
+
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid3.java b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid3.java
new file mode 100644
index 0000000..ffd0414
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/legacy/Valid3.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.legacy;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Validator;
+import java.util.Map;
+
+/**
+ * (Another) Valid JAXBContext factory class for tests
+ * - contains required static methods and creates dummy JAXBContext
+ * - several implementations necessary to test different configuration approaches
+ */
+public class Valid3 {
+
+    public static JAXBContext createContext(String path, ClassLoader cl) {
+        return new JAXBContext1();
+    }
+
+    public static JAXBContext createContext(Class[] classes, Map<String, Object> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+
+    public static class JAXBContext1 extends JAXBContext {
+
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/spi/Invalid.java b/jaxb-api-test/src/test/java/jaxb/factory/spi/Invalid.java
new file mode 100644
index 0000000..97aa949
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/spi/Invalid.java
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.spi;
+
+/**
+ * Invalid JAXBContext factory class for tests
+ * - doesn't contain required static methods
+ */
+public class Invalid {
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid.java b/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid.java
new file mode 100644
index 0000000..d2b54d4
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.spi;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBContextFactory;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Validator;
+import java.util.Map;
+
+/**
+ * Created by miran on 10/11/14.
+ */
+public class Valid implements JAXBContextFactory {
+
+    @Override
+    public JAXBContext createContext(Class<?>[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+    @Override
+    public JAXBContext createContext(String contextPath, ClassLoader classLoader, Map<String, ?> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+    public static class JAXBContext1 extends JAXBContext {
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid2.java b/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid2.java
new file mode 100644
index 0000000..1513e93
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid2.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.spi;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBContextFactory;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Validator;
+import java.util.Map;
+
+/**
+ * Created by miran on 10/11/14.
+ */
+public class Valid2 implements JAXBContextFactory {
+
+    @Override
+    public JAXBContext createContext(Class<?>[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+    @Override
+    public JAXBContext createContext(String contextPath, ClassLoader classLoader, Map<String, ?> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+    public static class JAXBContext1 extends JAXBContext {
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid3.java b/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid3.java
new file mode 100644
index 0000000..93c9436
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/factory/spi/Valid3.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.factory.spi;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBContextFactory;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Validator;
+import java.util.Map;
+
+/**
+ * Created by miran on 10/11/14.
+ */
+public class Valid3 implements JAXBContextFactory {
+
+    @Override
+    public JAXBContext createContext(Class<?>[] classesToBeBound, Map<String, ?> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+    @Override
+    public JAXBContext createContext(String contextPath, ClassLoader classLoader, Map<String, ?> properties) throws JAXBException {
+        return new JAXBContext1();
+    }
+
+    public static class JAXBContext1 extends JAXBContext {
+        @Override
+        public Unmarshaller createUnmarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Marshaller createMarshaller() throws JAXBException {
+            return null;
+        }
+
+        @Override
+        public Validator createValidator() throws JAXBException {
+            return null;
+        }
+    }
+
+}
diff --git a/jaxb-api-test/src/test/java/jaxb/test/usr/A.java b/jaxb-api-test/src/test/java/jaxb/test/usr/A.java
new file mode 100644
index 0000000..7c111e7
--- /dev/null
+++ b/jaxb-api-test/src/test/java/jaxb/test/usr/A.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package jaxb.test.usr;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Simple user class for testing creation of JAXBContext
+ */
+@XmlType
+@XmlRootElement
+public class A {
+
+    String name;
+}
diff --git a/jaxb-api-test/src/test/java/module-info.java b/jaxb-api-test/src/test/java/module-info.java
new file mode 100644
index 0000000..72311f1
--- /dev/null
+++ b/jaxb-api-test/src/test/java/module-info.java
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * Tests for jaxb API.
+ */
+module java.xml.bind.tests {
+    requires java.xml.bind;
+    requires java.logging;
+    requires junit;
+}
diff --git a/jaxb-api-test/src/test/resources/javax/xml/bind/test.policy b/jaxb-api-test/src/test/resources/javax/xml/bind/test.policy
new file mode 100644
index 0000000..a10467b
--- /dev/null
+++ b/jaxb-api-test/src/test/resources/javax/xml/bind/test.policy
@@ -0,0 +1,15 @@
+grant {
+      // security manager
+      permission java.lang.RuntimePermission "setSecurityManager";
+
+      permission java.lang.RuntimePermission "accessDeclaredMembers";
+
+      // writing configuration files
+      permission java.io.FilePermission "${classesDir}/-", "read, write, delete";
+
+      permission java.util.PropertyPermission "*", "read";
+      permission java.lang.RuntimePermission "*";
+
+      // reading / modifying jdk/conf/jaxm.properties
+      permission java.io.FilePermission "${java.home}${/}-", "read, write, delete";
+};
\ No newline at end of file
diff --git a/jaxb-api-test/src/test/resources/jaxb/test/usr/jaxb.index b/jaxb-api-test/src/test/resources/jaxb/test/usr/jaxb.index
new file mode 100644
index 0000000..8c7e5a6
--- /dev/null
+++ b/jaxb-api-test/src/test/resources/jaxb/test/usr/jaxb.index
@@ -0,0 +1 @@
+A
\ No newline at end of file
diff --git a/jaxb-api-test/src/test/resources/logging.properties b/jaxb-api-test/src/test/resources/logging.properties
new file mode 100644
index 0000000..51fc022
--- /dev/null
+++ b/jaxb-api-test/src/test/resources/logging.properties
@@ -0,0 +1,2 @@
+handlers = java.util.logging.ConsoleHandler
+java.util.logging.ConsoleHandler.level=FINEST
diff --git a/jaxb-api/pom.xml b/jaxb-api/pom.xml
new file mode 100644
index 0000000..255095e
--- /dev/null
+++ b/jaxb-api/pom.xml
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Distribution License v. 1.0, which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: BSD-3-Clause
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>jaxb-api-parent</artifactId>
+        <groupId>javax.xml.bind</groupId>
+        <version>2.3.2-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>jaxb-api</artifactId>
+    <packaging>jar</packaging>
+
+    <properties>
+        <config.dir>${project.basedir}/../etc/config</config.dir>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>javax.activation-api</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>3.1.0</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.glassfish.build</groupId>
+                    <artifactId>gfnexus-maven-plugin</artifactId>
+                    <version>0.20</version>
+                    <configuration>
+                        <stagingRepos>
+                            <stagingRepo>
+                                <ref>javax.xml.bind:jaxb-api:${project.version}:jar</ref>
+                                <profile>javax.xml.bind</profile>
+                            </stagingRepo>
+                        </stagingRepos>
+                        <promotionProfile>metro</promotionProfile>
+                        <message>JAXB_API-${project.version}</message>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-enforcer-plugin</artifactId>
+                    <configuration>
+                        <rules>
+                            <requireJavaVersion>
+                                <version>[1.8,)</version>
+                            </requireJavaVersion>
+                            <requireMavenVersion>
+                                <version>[3.0.3,)</version>
+                            </requireMavenVersion>
+                            <DependencyConvergence />
+                        </rules>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>cobertura-maven-plugin</artifactId>
+                    <version>2.7</version>
+                    <configuration>
+                        <formats>
+                            <format>xml</format>
+                        </formats>
+                        <check>
+                            <totalLineRate>45</totalLineRate>
+                            <packageLineRate>45</packageLineRate>
+                            <haltOnFailure>true</haltOnFailure>
+                        </check>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.glassfish.copyright</groupId>
+                    <artifactId>glassfish-copyright-maven-plugin</artifactId>
+                    <version>1.49</version>
+                    <configuration>
+                        <templateFile>${project.basedir}/copyright.txt</templateFile>
+                        <excludeFile>${project.basedir}/copyright-exclude</excludeFile>
+                        <!-- skip files not under SCM-->
+                        <scmOnly>true</scmOnly>
+                        <!-- turn off warnings -->
+                        <warn>true</warn>
+                        <!-- for use with repair -->
+                        <update>false</update>
+                        <!-- check that year is correct -->
+                        <ignoreYear>false</ignoreYear>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <version>3.1.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <version>3.1.0</version>
+                    <configuration>
+                        <archive>
+                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                            <manifestEntries>
+                                <Extension-Name>javax.xml.bind</Extension-Name>
+                                <Implementation-Build-Id>${scmBranch}-${buildNumber}, ${timestamp}</Implementation-Build-Id>
+                                <Multi-Release>true</Multi-Release>
+                            </manifestEntries>
+                            <manifest>
+                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+                            </manifest>
+                        </archive>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>buildnumber-maven-plugin</artifactId>
+                    <version>1.4</version>
+                    <configuration>
+                        <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
+                        <timestampFormat>{0,date,yyyy-MM-dd'T'HH:mm:ssZ}</timestampFormat>
+                        <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
+                        <revisionOnScmFailure>false</revisionOnScmFailure>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.felix</groupId>
+                    <artifactId>maven-bundle-plugin</artifactId>
+                    <extensions>true</extensions>
+                    <version>3.5.1</version>
+                    <configuration>
+                        <archive>
+                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                        </archive>
+                        <instructions>
+                            <Require-Capability>osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(version>=1.8))"</Require-Capability>
+                            <Bundle-Version>${project.version}</Bundle-Version>  <!-- 2.2.99.bnull -->
+                            <Extension-Name>${extension.name}</Extension-Name>
+                            <Implementation-Version>${spec.version}.${impl.version}</Implementation-Version>
+                            <Specification-Version>${project.version}</Specification-Version>
+                            <Export-Package>${extension.name}.*; version=${spec.version}</Export-Package>
+                            <Import-Package>
+                                javax.activation;version=!,
+                                javax.xml.bind;version="[${spec.version},3)",
+                                javax.xml.bind.annotation;version="[${spec.version},3)",
+                                javax.xml.bind.annotation.adapters;version="[${spec.version},3)",
+                                javax.xml.bind.attachment;version="[${spec.version},3)",
+                                javax.xml.bind.helpers;version="[${spec.version},3)",
+                                javax.xml.bind.util;version="[${spec.version},3)",
+                                javax.xml.datatype,
+                                javax.xml.namespace,
+                                javax.xml.parsers,
+                                javax.xml.stream,
+                                javax.xml.transform,
+                                javax.xml.transform.dom,
+                                javax.xml.transform.sax,
+                                javax.xml.transform.stream,
+                                javax.xml.validation,
+                                org.w3c.dom,
+                                org.xml.sax,
+                                org.xml.sax.ext,
+                                org.xml.sax.helpers
+                            </Import-Package>
+                            <Bundle-SymbolicName>jaxb-api</Bundle-SymbolicName>
+                            <DynamicImport-Package>org.glassfish.hk2.osgiresourcelocator</DynamicImport-Package>
+                            <Specification-Vendor>Oracle Corporation</Specification-Vendor>
+                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
+                            <Implementation-Vendor-Id>org.glassfish</Implementation-Vendor-Id>
+                        </instructions>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>findbugs-maven-plugin</artifactId>
+                    <version>3.0.5</version>
+                    <configuration>
+                        <skip>${findbugs.skip}</skip>
+                        <threshold>${findbugs.threshold}</threshold>
+                        <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
+                        <excludeFilterFile>
+                            ${findbugs.exclude}
+                        </excludeFilterFile>
+                        <fork>true</fork>
+                        <jvmArgs>-Xms64m -Xmx256m</jvmArgs>
+                    </configuration>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.glassfish.findbugs</groupId>
+                            <artifactId>findbugs</artifactId>
+                            <version>1.0</version>
+                        </dependency>
+                    </dependencies>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <configuration>
+                        <nodeprecated>false</nodeprecated>
+                        <use>false</use>
+                        <author>true</author>
+                        <version>true</version>
+                        <doctitle><![CDATA[<br>
+JAXB ${project.version} Runtime Library</h2>
+${project.name} specification, ${release.spec.date}<br>
+Comments to: <i><a href='mailto:${release.spec.feedback}'>${release.spec.feedback}</a></i><br>
+More information at: <i><a target='_top'
+href='http://jaxb.java.net'>http://jaxb.java.net</a></i><br>
+&nbsp;<br>&nbsp;<br><hr width='65%'><h1>${project.name}</h1><hr width='75%'>
+<br>&nbsp;<br>]]>
+                        </doctitle>
+                        <header><![CDATA[JAXB<br>v${project.version}]]>
+                        </header>
+                        <bottom><![CDATA[<font size=-1>
+<br>Comments to: <a href='mailto:${release.spec.feedback}'><i>${release.spec.feedback}</i></a>
+<br>More information at: <a target='_top'
+href='http://jaxb.java.net'><i>http://jaxb.java.net</i></a>
+<p>Copyright &copy; 2004-2017 Oracle </font>]]>
+                        </bottom>
+                        <detectJavaApiLink>false</detectJavaApiLink>
+                        <offlineLinks>
+                            <offlineLink>
+                                <url>http://download.oracle.com/javase/8/docs/api/</url>
+                                <location>${basedir}/offline-javadoc</location>
+                            </offlineLink>
+                        </offlineLinks>
+                        <tags>
+                            <tag>
+                                <name>apiNote</name>
+                                <!-- todo tag for all places -->
+                                <placement>a</placement>
+                                <head>API Note:</head>
+                            </tag>
+                            <tag>
+                                <name>implSpec</name>
+                                <!-- todo tag for all places -->
+                                <placement>a</placement>
+                                <head>Implementation Requirements:</head>
+                            </tag>
+                            <tag>
+                                <name>implNote</name>
+                                <!-- todo tag for all places -->
+                                <placement>a</placement>
+                                <head>Implementation Note:</head>
+                            </tag>
+                        </tags>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-release-plugin</artifactId>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>default-compile</id>
+                            <configuration>
+                                <release>8</release>
+                                <excludes>
+                                    <exclude>module-info.java</exclude>
+                                </excludes>
+                            </configuration>
+                        </execution>
+                        <execution>
+                            <id>module-info-compile</id>
+                            <phase>test-compile</phase><!--Avoid JavaSE9 capability added by bundle-plugin-->
+                            <goals>
+                                <goal>compile</goal>
+                            </goals>
+                            <configuration>
+                                <release>9</release>
+                                <includes>
+                                    <include>module-info.java</include>
+                                </includes>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/mr-jar/META-INF/versions/9</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${basedir}/src/main/mr-jar</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-enforcer-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>enforce-versions</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>initialize</id>
+                        <goals>
+                            <goal>properties</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>buildnumber-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>validate</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <id>compile-java9</id>
+                        <phase>compile</phase>
+                        <configuration>
+                            <tasks>
+                                <mkdir dir="${project.build.outputDirectory}/META-INF/versions/9" />
+                                <javac srcdir="${mrjar.sourceDirectory}" destdir="${project.build.outputDirectory}/META-INF/versions/9" classpath="${project.build.outputDirectory}" includeantruntime="false" source="9" target="9" />
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>update-source-jar</id>
+                        <phase>verify</phase>
+                        <configuration>
+                            <tasks>
+                                <jar destfile="${project.build.directory}/jaxb-api-${project.version}-sources.jar" update="true">
+                                    <fileset dir="${project.build.directory}/mr-jar/" />
+                                </jar>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+
+
+
+</project>
diff --git a/jaxb-api/src/main/java/javax/xml/bind/Binder.java b/jaxb-api/src/main/java/javax/xml/bind/Binder.java
new file mode 100644
index 0000000..7266f3c
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/Binder.java
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+import javax.xml.validation.Schema;
+
+/**
+ * Enable synchronization between XML infoset nodes and JAXB objects 
+ * representing same XML document.
+ *
+ * <p>
+ * An instance of this class maintains the association between XML nodes of
+ * an infoset preserving view and a JAXB representation of an XML document. 
+ * Navigation between the two views is provided by the methods
+ * {@link #getXMLNode(Object)} and {@link #getJAXBNode(Object)}.
+ * 
+ * <p>
+ * Modifications can be made to either the infoset preserving view or the 
+ * JAXB representation of the document while the other view remains 
+ * unmodified. The binder is able to synchronize the changes made in the 
+ * modified view back into the other view using the appropriate
+ * Binder update methods, {@link #updateXML(Object, Object)} or 
+ * {@link #updateJAXB(Object)}.
+ * 
+ * <p>
+ * A typical usage scenario is the following:
+ * <ul>
+ *   <li>load XML document into an XML infoset representation</li>
+ *   <li>{@link #unmarshal(Object)} XML infoset view to JAXB view.
+ *       (Note to conserve resources, it is possible to only unmarshal a
+ *       subtree of the XML infoset view to the JAXB view.)</li>
+ *   <li>application access/updates JAXB view of XML document.</li>
+ *   <li>{@link #updateXML(Object)} synchronizes modifications to JAXB view 
+ *       back into the XML infoset view. Update operation preserves as 
+ *       much of original XML infoset as possible (i.e. comments, PI, ...)</li>
+ * </ul>
+ * 
+ * <p>
+ * A Binder instance is created using the factory method 
+ * {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
+ *
+ * <p>
+ * The template parameter, <code>XmlNode</code>, is the
+ * root interface/class for the XML infoset preserving representation.
+ * A Binder implementation is required to minimally support
+ * an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>. 
+ * A Binder implementation can support alternative XML infoset 
+ * preserving representations.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ *     Joseph Fialli
+ * 
+ * @since 1.6, JAXB 2.0
+ */
+public abstract class Binder<XmlNode> {
+    /**
+     * Unmarshal XML infoset view to a JAXB object tree.
+     *
+     * <p>
+     * This method is similar to {@link Unmarshaller#unmarshal(Node)}
+     * with the addition of maintaining the association between XML nodes 
+     * and the produced JAXB objects, enabling future update operations,
+     * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+     *
+     * <p>
+     * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+     * and its descendants is validated during this operation.
+     *
+     * <p>
+     * This method throws {@link UnmarshalException} when the Binder's
+     * {@link JAXBContext} does not have a mapping for the XML element name
+     * or the type, specifiable via {@code @xsi:type}, of {@code xmlNode}
+     * to a JAXB mapped class. The method {@link #unmarshal(Object, Class)} 
+     * enables an application to specify the JAXB mapped class that
+     * the {@code xmlNode} should be mapped to.
+     *
+     * @param xmlNode 
+     *      the document/element to unmarshal XML data from.
+     *
+     * @return
+     *      the newly created root object of the JAXB object tree.
+     *
+     * @throws JAXBException
+     *      If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Binder} is unable to perform the XML to Java
+     *     binding.
+     * @throws IllegalArgumentException
+     *      If the node parameter is null
+     */
+    public abstract Object unmarshal( XmlNode xmlNode ) throws JAXBException;
+
+    /**
+     * Unmarshal XML root element by provided {@code declaredType}
+     * to a JAXB object tree.
+     *
+     * <p>
+     * Implements <a href="Unmarshaller.html#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+     * 
+     * <p>
+     * This method is similar to {@link Unmarshaller#unmarshal(Node, Class)}
+     * with the addition of maintaining the association between XML nodes 
+     * and the produced JAXB objects, enabling future update operations,
+     * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+     *
+     * <p>
+     * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+     * and its descendants is validated during this operation.
+     *
+     * @param xmlNode 
+     *      the document/element to unmarshal XML data from.
+     * @param declaredType
+     *      appropriate JAXB mapped class to hold {@code node}'s XML data.
+     *
+     * @return
+     * <a href="JAXBElement.html">JAXB Element</a> representation 
+     * of {@code node}
+     *
+     * @throws JAXBException
+     *      If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Binder} is unable to perform the XML to Java
+     *     binding.
+     * @throws IllegalArgumentException
+     *      If any of the input parameters are null
+     * @since 1.6, JAXB 2.0
+     */
+    public abstract <T> JAXBElement<T> 
+	unmarshal( XmlNode xmlNode, Class<T> declaredType ) 
+	throws JAXBException;
+
+    /**
+     * Marshal a JAXB object tree to a new XML document.
+     *
+     * <p>
+     * This method is similar to {@link Marshaller#marshal(Object, Node)}
+     * with the addition of maintaining the association between JAXB objects 
+     * and the produced XML nodes,
+     * enabling future update operations such as 
+     * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+     *
+     * <p>
+     * When {@link #getSchema()} is non-null, the marshalled
+     * xml content is validated during this operation.
+     *
+     * @param jaxbObject
+     *      The content tree to be marshalled. 
+     * @param xmlNode
+     *      The parameter must be a Node that accepts children.
+     *
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Binder} is unable to marshal {@code jaxbObject} (or any
+     *      object reachable from {@code jaxbObject}).
+     * 
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     */
+    public abstract void marshal( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+    /**
+     * Gets the XML element associated with the given JAXB object.
+     *
+     * <p>
+     * Once a JAXB object tree is associated with an XML fragment,
+     * this method enables navigation between the two trees.
+     *
+     * <p>
+     * An association between an XML element and a JAXB object is
+     * established by the bind methods and the update methods.
+     * Note that this association is partial; not all XML elements
+     * have associated JAXB objects, and not all JAXB objects have
+     * associated XML elements.
+     *
+     * @param jaxbObject An instance that is reachable from a prior 
+     *                   call to a bind or update method that returned
+     *                   a JAXB object tree.
+     *
+     * @return
+     *      null if the specified JAXB object is not known to this
+     *      {@link Binder}, or if it is not associated with an
+     *      XML element.
+     *
+     * @throws IllegalArgumentException
+     *      If the jaxbObject parameter is null
+     */
+    public abstract XmlNode getXMLNode( Object jaxbObject );
+
+    /**
+     * Gets the JAXB object associated with the given XML element.
+     *
+     * <p>
+     * Once a JAXB object tree is associated with an XML fragment,
+     * this method enables navigation between the two trees.
+     *
+     * <p>
+     * An association between an XML element and a JAXB object is
+     * established by the unmarshal, marshal and update methods.
+     * Note that this association is partial; not all XML elements
+     * have associated JAXB objects, and not all JAXB objects have
+     * associated XML elements.
+     *
+     * @return
+     *      null if the specified XML node is not known to this
+     *      {@link Binder}, or if it is not associated with a
+     *      JAXB object.
+     *
+     * @throws IllegalArgumentException
+     *      If the node parameter is null
+     */
+    public abstract Object getJAXBNode( XmlNode xmlNode );
+
+    /**
+     * Takes an JAXB object and updates
+     * its associated XML node and its descendants.
+     *
+     * <p>
+     * This is a convenience method of:
+     * <pre>
+     * updateXML( jaxbObject, getXMLNode(jaxbObject));
+     * </pre>
+     *
+     * @throws JAXBException
+     *      If any unexpected problem occurs updating corresponding XML content.
+     * @throws IllegalArgumentException
+     *      If the jaxbObject parameter is null
+     */
+    public abstract XmlNode updateXML( Object jaxbObject ) throws JAXBException;
+
+    /**
+     * Changes in JAXB object tree are updated in its associated XML parse tree.
+     *
+     * <p>
+     * This operation can be thought of as an "in-place" marshalling.
+     * The difference is that instead of creating a whole new XML tree,
+     * this operation updates an existing tree while trying to preserve
+     * the XML as much as possible.
+     *
+     * <p>
+     * For example, unknown elements/attributes in XML that were not bound
+     * to JAXB will be left untouched (whereas a marshalling operation
+     * would create a new tree that doesn't contain any of those.)
+     *
+     * <p>
+     * As a side-effect, this operation updates the association between
+     * XML nodes and JAXB objects.
+     *
+     * @param jaxbObject root of potentially modified JAXB object tree
+     * @param xmlNode    root of update target XML parse tree
+     *
+     * @return
+     *      Returns the updated XML node. Typically, this is the same
+     *      node you passed in as <i>xmlNode</i>, but it maybe
+     *      a different object, for example when the tag name of the object
+     *      has changed.
+     *
+     * @throws JAXBException
+     *      If any unexpected problem occurs updating corresponding XML content.
+     * @throws IllegalArgumentException
+     *      If any of the input parameters are null
+     */
+    public abstract XmlNode updateXML( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+    /**
+     * Takes an XML node and updates its associated JAXB object and its descendants.
+     *
+     * <p>
+     * This operation can be thought of as an "in-place" unmarshalling.
+     * The difference is that instead of creating a whole new JAXB tree,
+     * this operation updates an existing tree, reusing as much JAXB objects
+     * as possible.
+     *
+     * <p>
+     * As a side-effect, this operation updates the association between
+     * XML nodes and JAXB objects.
+     *
+     * @return
+     *      Returns the updated JAXB object. Typically, this is the same
+     *      object that was returned from earlier
+     *      {@link #marshal(Object,Object)} or
+     *      {@link #updateJAXB(Object)} method invocation,
+     *      but it maybe
+     *      a different object, for example when the name of the XML
+     *      element has changed.
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs updating corresponding JAXB mapped content.
+     * @throws IllegalArgumentException
+     *      If node parameter is null
+     */
+    public abstract Object updateJAXB( XmlNode xmlNode ) throws JAXBException;
+
+
+    /**
+     * Specifies whether marshal, unmarshal and update methods
+     * performs validation on their XML content.
+     *
+     * @param schema set to null to disable validation.
+     *
+     * @see Unmarshaller#setSchema(Schema)
+     */
+    public abstract void setSchema( Schema schema );
+
+    /**
+     * Gets the last {@link Schema} object (including null) set by the
+     * {@link #setSchema(Schema)} method.
+     *
+     * @return the Schema object for validation or null if not present
+     */
+    public abstract Schema getSchema();
+
+    /**
+     * Allow an application to register a {@code ValidationEventHandler}.
+     * <p>
+     * The {@code ValidationEventHandler} will be called by the JAXB Provider
+     * if any validation errors are encountered during calls to any of the
+     * Binder unmarshal, marshal and update methods.  
+     * 
+     * <p>
+     * Calling this method with a null parameter will cause the Binder
+     * to revert back to the default default event handler.
+     *
+     * @param handler the validation event handler
+     * @throws JAXBException if an error was encountered while setting the
+     *         event handler
+     */
+    public abstract void setEventHandler( ValidationEventHandler handler ) throws JAXBException;
+
+    /**
+     * Return the current event handler or the default event handler if one
+     * hasn't been set.
+     *
+     * @return the current ValidationEventHandler or the default event handler
+     *         if it hasn't been set
+     * @throws JAXBException if an error was encountered while getting the
+     *         current event handler
+     */
+    public abstract ValidationEventHandler getEventHandler() throws JAXBException;
+
+    /**
+     * 
+     * Set the particular property in the underlying implementation of
+     * {@code Binder}.  This method can only be used to set one of
+     * the standard JAXB defined unmarshal/marshal properties 
+     * or a provider specific property for binder, unmarshal or marshal.
+     * Attempting to set an undefined property will result in
+     * a PropertyException being thrown.  See 
+     * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+     * and
+     * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+     *
+     * @param name the name of the property to be set. This value can either
+     *              be specified using one of the constant fields or a user
+     *              supplied string.
+     * @param value the value of the property to be set
+     *
+     * @throws PropertyException when there is an error processing the given
+     *                            property or value
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     */
+    abstract public void setProperty( String name, Object value ) throws PropertyException;
+
+
+    /**
+     * Get the particular property in the underlying implementation of
+     * {@code Binder}.  This method can only
+     * be used to get one of
+     * the standard JAXB defined unmarshal/marshal properties 
+     * or a provider specific property for binder, unmarshal or marshal.  
+     * Attempting to get an undefined property will result in
+     * a PropertyException being thrown.  See 
+     * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+     * and
+     * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+     *
+     * @param name the name of the property to retrieve
+     * @return the value of the requested property
+     *
+     * @throws PropertyException
+     *      when there is an error retrieving the given property or value
+     *      property name
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     */
+    abstract public Object getProperty( String name ) throws PropertyException;
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ContextFinder.java b/jaxb-api/src/main/java/javax/xml/bind/ContextFinder.java
new file mode 100644
index 0000000..93ea7d4
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ContextFinder.java
@@ -0,0 +1,641 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+
+/**
+ * This class is package private and therefore is not exposed as part of the
+ * JAXB API.
+ *
+ * This code is designed to implement the JAXB 1.0 spec pluggability feature
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBContext
+ */
+class ContextFinder {
+
+    /**
+     * When JAXB is in J2SE, rt.jar has to have a JAXB implementation.
+     * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext
+     * because if it has, it will take precedence over any file that applications have
+     * in their jar files.
+     *
+     * <p>
+     * When the user bundles his own JAXB implementation, we'd like to use it, and we
+     * want the platform default to be used only when there's no other JAXB provider.
+     *
+     * <p>
+     * For this reason, we have to hard-code the class name into the API.
+     */
+    private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.internal.bind.v2.ContextFactory";
+
+    // previous value of JAXBContext.JAXB_CONTEXT_FACTORY, using also this to ensure backwards compatibility
+    private static final String JAXB_CONTEXT_FACTORY_DEPRECATED = "javax.xml.bind.context.factory";
+
+    private static final Logger logger;
+
+    static {
+        logger = Logger.getLogger("javax.xml.bind");
+        try {
+            if (AccessController.doPrivileged(new GetPropertyAction("jaxb.debug")) != null) {
+                // disconnect the logger from a bigger framework (if any)
+                // and take the matters into our own hands
+                logger.setUseParentHandlers(false);
+                logger.setLevel(Level.ALL);
+                ConsoleHandler handler = new ConsoleHandler();
+                handler.setLevel(Level.ALL);
+                logger.addHandler(handler);
+            } else {
+                // don't change the setting of this logger
+                // to honor what other frameworks
+                // have done on configurations.
+            }
+        } catch (Throwable t) {
+            // just to be extra safe. in particular System.getProperty may throw
+            // SecurityException.
+        }
+    }
+
+    private static ServiceLoaderUtil.ExceptionHandler<JAXBException> EXCEPTION_HANDLER =
+            new ServiceLoaderUtil.ExceptionHandler<JAXBException>() {
+                @Override
+                public JAXBException createException(Throwable throwable, String message) {
+                    return new JAXBException(message, throwable);
+                }
+            };
+
+    /**
+     * If the {@link InvocationTargetException} wraps an exception that shouldn't be wrapped,
+     * throw the wrapped exception. Otherwise returns exception to be wrapped for further processing.
+     */
+    private static Throwable handleInvocationTargetException(InvocationTargetException x) throws JAXBException {
+        Throwable t = x.getTargetException();
+        if (t != null) {
+            if (t instanceof JAXBException)
+                // one of our exceptions, just re-throw
+                throw (JAXBException) t;
+            if (t instanceof RuntimeException)
+                // avoid wrapping exceptions unnecessarily
+                throw (RuntimeException) t;
+            if (t instanceof Error)
+                throw (Error) t;
+            return t;
+        }
+        return x;
+    }
+
+
+    /**
+     * Determine if two types (JAXBContext in this case) will generate a ClassCastException.
+     *
+     * For example, (targetType)originalType
+     *
+     * @param originalType
+     *          The Class object of the type being cast
+     * @param targetType
+     *          The Class object of the type that is being cast to
+     * @return JAXBException to be thrown.
+     */
+    private static JAXBException handleClassCastException(Class originalType, Class targetType) {
+        final URL targetTypeURL = which(targetType);
+
+        return new JAXBException(Messages.format(Messages.ILLEGAL_CAST,
+                // we don't care where the impl class is, we want to know where JAXBContext lives in the impl
+                // class' ClassLoader
+                getClassClassLoader(originalType).getResource("javax/xml/bind/JAXBContext.class"),
+                targetTypeURL));
+    }
+
+    /**
+     * Create an instance of a class using the specified ClassLoader
+     */
+    static JAXBContext newInstance(String contextPath,
+                                   Class[] contextPathClasses,
+                                   String className,
+                                   ClassLoader classLoader,
+                                   Map properties) throws JAXBException {
+
+        try {
+            Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader);
+            return newInstance(contextPath, contextPathClasses, spFactory, classLoader, properties);
+        } catch (ClassNotFoundException x) {
+            throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), x);
+
+        } catch (RuntimeException | JAXBException x) {
+            // avoid wrapping RuntimeException to JAXBException,
+            // because it indicates a bug in this code.
+            // JAXBException re-thrown as is
+            throw x;
+        } catch (Exception x) {
+            // can't catch JAXBException because the method is hidden behind
+            // reflection.  Root element collisions detected in the call to
+            // createContext() are reported as JAXBExceptions - just re-throw it
+            // some other type of exception - just wrap it
+            throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, className, x), x);
+        }
+    }
+
+    static JAXBContext newInstance(String contextPath,
+                                   Class[] contextPathClasses,
+                                   Class spFactory,
+                                   ClassLoader classLoader,
+                                   Map properties) throws JAXBException {
+
+        try {
+
+            ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, spFactory);
+
+            /*
+             * javax.xml.bind.context.factory points to a class which has a
+             * static method called 'createContext' that
+             * returns a javax.xml.JAXBContext.
+             */
+
+            Object context = null;
+
+            // first check the method that takes Map as the third parameter.
+            // this is added in 2.0.
+            try {
+                Method m = spFactory.getMethod("createContext", String.class, ClassLoader.class, Map.class);
+                // any failure in invoking this method would be considered fatal
+                Object obj = instantiateProviderIfNecessary(spFactory);
+                context = m.invoke(obj, contextPath, classLoader, properties);
+            } catch (NoSuchMethodException ignored) {
+                // it's not an error for the provider not to have this method.
+            }
+
+            if (context == null) {
+                // try the old method that doesn't take properties. compatible with 1.0.
+                // it is an error for an implementation not to have both forms of the createContext method.
+                Method m = spFactory.getMethod("createContext", String.class, ClassLoader.class);
+                Object obj = instantiateProviderIfNecessary(spFactory);
+                // any failure in invoking this method would be considered fatal
+                context = m.invoke(obj, contextPath, classLoader);
+            }
+
+            if (!(context instanceof JAXBContext)) {
+                // the cast would fail, so generate an exception with a nice message
+                throw handleClassCastException(context.getClass(), JAXBContext.class);
+            }
+
+            return (JAXBContext) context;
+        } catch (InvocationTargetException x) {
+            // throw if it is exception not to be wrapped
+            // otherwise, wrap with a JAXBException
+            Throwable e = handleInvocationTargetException(x);
+            throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, spFactory, e), e);
+
+        } catch (Exception x) {
+            // can't catch JAXBException because the method is hidden behind
+            // reflection.  Root element collisions detected in the call to
+            // createContext() are reported as JAXBExceptions - just re-throw it
+            // some other type of exception - just wrap it
+            throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, spFactory, x), x);
+        }
+    }
+
+    private static Object instantiateProviderIfNecessary(final Class<?> implClass) throws JAXBException {
+        try {
+            if (JAXBContextFactory.class.isAssignableFrom(implClass)) {
+                return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
+                    @Override
+                    public Object run() throws Exception {
+                        return implClass.newInstance();
+                    }
+                });
+            }
+            return null;
+        } catch (PrivilegedActionException x) {
+            Throwable e = (x.getCause() == null) ? x : x.getCause();
+            throw new JAXBException(Messages.format(Messages.COULD_NOT_INSTANTIATE, implClass, e), e);
+        }
+    }
+
+    /**
+     * Create an instance of a class using the thread context ClassLoader
+     */
+    static JAXBContext newInstance(Class[] classes, Map properties, String className) throws JAXBException {
+
+        Class spi;
+        try {
+            spi = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, getContextClassLoader());
+        } catch (ClassNotFoundException e) {
+            throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), e);
+        }
+
+        if (logger.isLoggable(Level.FINE)) {
+            // extra check to avoid costly which operation if not logged
+            logger.log(Level.FINE, "loaded {0} from {1}", new Object[]{className, which(spi)});
+        }
+
+        return newInstance(classes, properties, spi);
+    }
+
+    static JAXBContext newInstance(Class[] classes,
+                                   Map properties,
+                                   Class spFactory) throws JAXBException {
+        try {
+            ModuleUtil.delegateAddOpensToImplModule(classes,  spFactory);
+
+            Method m = spFactory.getMethod("createContext", Class[].class, Map.class);
+            Object obj = instantiateProviderIfNecessary(spFactory);
+            Object context = m.invoke(obj, classes, properties);
+            if (!(context instanceof JAXBContext)) {
+                // the cast would fail, so generate an exception with a nice message
+                throw handleClassCastException(context.getClass(), JAXBContext.class);
+            }
+            return (JAXBContext) context;
+
+        } catch (NoSuchMethodException | IllegalAccessException e) {
+            throw new JAXBException(e);
+        } catch (InvocationTargetException e) {
+            // throw if it is exception not to be wrapped
+            // otherwise, wrap with a JAXBException
+            Throwable x = handleInvocationTargetException(e);
+
+            throw new JAXBException(x);
+        }
+    }
+
+    static JAXBContext find(String factoryId,
+                            String contextPath,
+                            ClassLoader classLoader,
+                            Map properties) throws JAXBException {
+
+        if (contextPath == null || contextPath.isEmpty()) {
+            // no context is specified
+            throw new JAXBException(Messages.format(Messages.NO_PACKAGE_IN_CONTEXTPATH));
+        }
+
+        //ModuleUtil is mr-jar class, scans context path for jaxb classes on jdk9 and higher
+        Class[] contextPathClasses = ModuleUtil.getClassesFromContextPath(contextPath, classLoader);
+
+        //first try with classloader#getResource
+        String factoryClassName = jaxbProperties(contextPath, classLoader, factoryId);
+        if (factoryClassName == null && contextPathClasses != null) {
+            //try with class#getResource
+            factoryClassName = jaxbProperties(contextPathClasses, factoryId);
+        }
+
+        if (factoryClassName != null) {
+            return newInstance(contextPath, contextPathClasses, factoryClassName, classLoader, properties);
+        }
+
+
+        String factoryName = classNameFromSystemProperties();
+        if (factoryName != null) return newInstance(contextPath, contextPathClasses, factoryName, classLoader, properties);
+
+        JAXBContextFactory obj = ServiceLoaderUtil.firstByServiceLoader(
+                JAXBContextFactory.class, logger, EXCEPTION_HANDLER);
+
+        if (obj != null) {
+            ModuleUtil.delegateAddOpensToImplModule(contextPathClasses, obj.getClass());
+            return obj.createContext(contextPath, classLoader, properties);
+        }
+
+        // to ensure backwards compatibility
+        factoryName = firstByServiceLoaderDeprecated(JAXBContext.class, classLoader);
+        if (factoryName != null) return newInstance(contextPath, contextPathClasses, factoryName, classLoader, properties);
+
+        Class ctxFactory = (Class) ServiceLoaderUtil.lookupUsingOSGiServiceLoader(
+                "javax.xml.bind.JAXBContext", logger);
+
+        if (ctxFactory != null) {
+            return newInstance(contextPath, contextPathClasses, ctxFactory, classLoader, properties);
+        }
+
+        // else no provider found
+        logger.fine("Trying to create the platform default provider");
+        return newInstance(contextPath, contextPathClasses, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader, properties);
+    }
+
+    static JAXBContext find(Class<?>[] classes, Map<String, ?> properties) throws JAXBException {
+
+        // search for jaxb.properties in the class loader of each class first
+        logger.fine("Searching jaxb.properties");
+        for (final Class c : classes) {
+            // this classloader is used only to load jaxb.properties, so doing this should be safe.
+            // this is possible for primitives, arrays, and classes that are
+            // loaded by poorly implemented ClassLoaders
+            if (c.getPackage() == null) continue;
+
+            // TODO: do we want to optimize away searching the same package?  org.Foo, org.Bar, com.Baz
+            // classes from the same package might come from different class loades, so it might be a bad idea
+            // TODO: it's easier to look things up from the class
+            // c.getResourceAsStream("jaxb.properties");
+
+            URL jaxbPropertiesUrl = getResourceUrl(c, "jaxb.properties");
+
+            if (jaxbPropertiesUrl != null) {
+
+                String factoryClassName =
+                        classNameFromPackageProperties(
+                                jaxbPropertiesUrl,
+                                JAXBContext.JAXB_CONTEXT_FACTORY, JAXB_CONTEXT_FACTORY_DEPRECATED);
+
+                return newInstance(classes, properties, factoryClassName);
+            }
+
+        }
+
+        String factoryClassName = classNameFromSystemProperties();
+        if (factoryClassName != null) return newInstance(classes, properties, factoryClassName);
+
+        JAXBContextFactory factory =
+                ServiceLoaderUtil.firstByServiceLoader(JAXBContextFactory.class, logger, EXCEPTION_HANDLER);
+
+        if (factory != null) {
+            ModuleUtil.delegateAddOpensToImplModule(classes, factory.getClass());
+            return factory.createContext(classes, properties);
+        }
+
+        // to ensure backwards compatibility
+        String className = firstByServiceLoaderDeprecated(JAXBContext.class, getContextClassLoader());
+        if (className != null) return newInstance(classes, properties, className);
+
+        logger.fine("Trying to create the platform default provider");
+        Class ctxFactoryClass =
+                (Class) ServiceLoaderUtil.lookupUsingOSGiServiceLoader("javax.xml.bind.JAXBContext", logger);
+
+        if (ctxFactoryClass != null) {
+            return newInstance(classes, properties, ctxFactoryClass);
+        }
+
+        // else no provider found
+        logger.fine("Trying to create the platform default provider");
+        return newInstance(classes, properties, PLATFORM_DEFAULT_FACTORY_CLASS);
+    }
+
+
+    /**
+     * first factoryId should be the preferred one,
+     * more of those can be provided to support backwards compatibility
+     */
+    private static String classNameFromPackageProperties(URL packagePropertiesUrl,
+                                                         String ... factoryIds) throws JAXBException {
+
+        logger.log(Level.FINE, "Trying to locate {0}", packagePropertiesUrl.toString());
+        Properties props = loadJAXBProperties(packagePropertiesUrl);
+        for(String factoryId : factoryIds) {
+            if (props.containsKey(factoryId)) {
+                return props.getProperty(factoryId);
+            }
+        }
+        //Factory key not found
+        String propertiesUrl = packagePropertiesUrl.toExternalForm();
+        String packageName = propertiesUrl.substring(0, propertiesUrl.indexOf("/jaxb.properties"));
+        throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, factoryIds[0]));
+    }
+
+    private static String classNameFromSystemProperties() throws JAXBException {
+
+        String factoryClassName = getSystemProperty(JAXBContext.JAXB_CONTEXT_FACTORY);
+        if (factoryClassName != null) {
+            return factoryClassName;
+        }
+        // leave this here to assure compatibility
+        factoryClassName = getDeprecatedSystemProperty(JAXB_CONTEXT_FACTORY_DEPRECATED);
+        if (factoryClassName != null) {
+            return factoryClassName;
+        }
+        // leave this here to assure compatibility
+        factoryClassName = getDeprecatedSystemProperty(JAXBContext.class.getName());
+        if (factoryClassName != null) {
+            return factoryClassName;
+        }
+        return null;
+    }
+
+    private static String getDeprecatedSystemProperty(String property) {
+        String value = getSystemProperty(property);
+        if (value != null) {
+            logger.log(Level.WARNING, "Using non-standard property: {0}. Property {1} should be used instead.",
+                    new Object[] {property, JAXBContext.JAXB_CONTEXT_FACTORY});
+        }
+        return value;
+    }
+
+    private static String getSystemProperty(String property) {
+        logger.log(Level.FINE, "Checking system property {0}", property);
+        String value = AccessController.doPrivileged(new GetPropertyAction(property));
+        if (value != null) {
+            logger.log(Level.FINE, "  found {0}", value);
+        } else {
+            logger.log(Level.FINE, "  not found");
+        }
+        return value;
+    }
+
+    private static Properties loadJAXBProperties(URL url) throws JAXBException {
+
+        try {
+            Properties props;
+            logger.log(Level.FINE, "loading props from {0}", url);
+            props = new Properties();
+            InputStream is = url.openStream();
+            props.load(is);
+            is.close();
+            return props;
+        } catch (IOException ioe) {
+            logger.log(Level.FINE, "Unable to load " + url.toString(), ioe);
+            throw new JAXBException(ioe.toString(), ioe);
+        }
+    }
+
+    /**
+     * If run on JPMS package containing resource must be open unconditionally.
+     *
+     * @param classLoader classloader to load resource with
+     * @param resourceName qualified name of the resource
+     * @return resource url if found
+     */
+    private static URL getResourceUrl(ClassLoader classLoader, String resourceName) {
+        URL url;
+        if (classLoader == null)
+            url = ClassLoader.getSystemResource(resourceName);
+        else
+            url = classLoader.getResource(resourceName);
+        return url;
+    }
+
+    private static URL getResourceUrl(Class<?> clazz, String resourceName) {
+        return clazz.getResource(resourceName);
+    }
+
+
+    /**
+     * Search the given ClassLoader for an instance of the specified class and
+     * return a string representation of the URL that points to the resource.
+     *
+     * @param clazz
+     *          The class to search for
+     * @param loader
+     *          The ClassLoader to search.  If this parameter is null, then the
+     *          system class loader will be searched
+     * @return
+     *          the URL for the class or null if it wasn't found
+     */
+    static URL which(Class clazz, ClassLoader loader) {
+
+        String classnameAsResource = clazz.getName().replace('.', '/') + ".class";
+
+        if (loader == null) {
+            loader = getSystemClassLoader();
+        }
+
+        return loader.getResource(classnameAsResource);
+    }
+
+    /**
+     * Get the URL for the Class from it's ClassLoader.
+     *
+     * Convenience method for {@link #which(Class, ClassLoader)}.
+     *
+     * Equivalent to calling: which(clazz, clazz.getClassLoader())
+     *
+     * @param clazz
+     *          The class to search for
+     * @return
+     *          the URL for the class or null if it wasn't found
+     */
+    static URL which(Class clazz) {
+        return which(clazz, getClassClassLoader(clazz));
+    }
+
+    @SuppressWarnings("unchecked")
+    private static ClassLoader getContextClassLoader() {
+        if (System.getSecurityManager() == null) {
+            return Thread.currentThread().getContextClassLoader();
+        } else {
+            return (ClassLoader) java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction() {
+                        @Override
+                        public java.lang.Object run() {
+                            return Thread.currentThread().getContextClassLoader();
+                        }
+                    });
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private static ClassLoader getClassClassLoader(final Class c) {
+        if (System.getSecurityManager() == null) {
+            return c.getClassLoader();
+        } else {
+            return (ClassLoader) java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction() {
+                        @Override
+                        public java.lang.Object run() {
+                            return c.getClassLoader();
+                        }
+                    });
+        }
+    }
+
+    private static ClassLoader getSystemClassLoader() {
+        if (System.getSecurityManager() == null) {
+            return ClassLoader.getSystemClassLoader();
+        } else {
+            return (ClassLoader) java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction() {
+                        @Override
+                        public java.lang.Object run() {
+                            return ClassLoader.getSystemClassLoader();
+                        }
+                    });
+        }
+    }
+
+    // ServiceLoaderUtil.firstByServiceLoaderDeprecated should be used instead.
+    @Deprecated
+    static String firstByServiceLoaderDeprecated(Class spiClass,
+                                                 ClassLoader classLoader) throws JAXBException {
+
+        final String jaxbContextFQCN = spiClass.getName();
+
+        logger.fine("Searching META-INF/services");
+
+        // search META-INF services next
+        BufferedReader r = null;
+        final String resource = "META-INF/services/" + jaxbContextFQCN;
+        try {
+            final InputStream resourceStream =
+                    (classLoader == null) ?
+                            ClassLoader.getSystemResourceAsStream(resource) :
+                            classLoader.getResourceAsStream(resource);
+
+            if (resourceStream != null) {
+                r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8"));
+                String factoryClassName = r.readLine();
+                if (factoryClassName != null) {
+                    factoryClassName = factoryClassName.trim();
+                }
+                r.close();
+                logger.log(Level.FINE, "Configured factorty class:{0}", factoryClassName);
+                return factoryClassName;
+            } else {
+                logger.log(Level.FINE, "Unable to load:{0}", resource);
+                return null;
+            }
+        } catch (IOException e) {
+            throw new JAXBException(e);
+        } finally {
+            try {
+                if (r != null) {
+                    r.close();
+                }
+            } catch (IOException ex) {
+                logger.log(Level.SEVERE, "Unable to close resource: " + resource, ex);
+            }
+        }
+    }
+
+    private static String jaxbProperties(String contextPath, ClassLoader classLoader, String factoryId) throws JAXBException {
+        String[] packages = contextPath.split(":");
+
+        for (String pkg : packages) {
+            String pkgUrl = pkg.replace('.', '/');
+            URL jaxbPropertiesUrl = getResourceUrl(classLoader, pkgUrl + "/jaxb.properties");
+            if (jaxbPropertiesUrl != null) {
+                return classNameFromPackageProperties(jaxbPropertiesUrl,
+                                                      factoryId, JAXB_CONTEXT_FACTORY_DEPRECATED);
+            }
+        }
+        return null;
+    }
+
+    private static String jaxbProperties(Class[] classesFromContextPath, String factoryId) throws JAXBException {
+        for (Class c : classesFromContextPath) {
+            URL jaxbPropertiesUrl = getResourceUrl(c, "jaxb.properties");
+            if (jaxbPropertiesUrl != null) {
+                return classNameFromPackageProperties(jaxbPropertiesUrl, factoryId, JAXB_CONTEXT_FACTORY_DEPRECATED);
+            }
+        }
+        return null;
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java b/jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java
new file mode 100644
index 0000000..60d9a97
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * Exception that represents a failure in a JAXB operation.
+ *
+ * <p>
+ * This exception differs from {@link JAXBException} in that
+ * this is an unchecked exception, while {@code JAXBException}
+ * is a checked exception.
+ *
+ * @see JAXB
+ * @since 1.6, JAXB 2.1
+ */
+public class DataBindingException extends RuntimeException {
+    public DataBindingException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public DataBindingException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java b/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java
new file mode 100644
index 0000000..2869de9
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java
@@ -0,0 +1,680 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ * <p>
+ * The javaType binding declaration can be used to customize the binding of 
+ * an XML schema datatype to a Java datatype. Customizations can involve 
+ * writing a parse and print method for parsing and printing lexical 
+ * representations of a XML schema datatype respectively. However, writing 
+ * parse and print methods requires knowledge of the lexical representations ( 
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes 
+ * specification </a>) and hence may be difficult to write. 
+ * </p>
+ * <p>
+ * This class makes it easier to write parse and print methods. It defines
+ * static parse and print methods that provide access to a JAXB provider's 
+ * implementation of parse and print methods. These methods are invoked by 
+ * custom parse and print methods. For example, the binding of xsd:dateTime 
+ * to a long can be customized using parse and print methods as follows:
+ * <blockquote>
+ *    <pre>
+ *    // Customized parse method 
+ *    public long myParseCal( String dateTimeString ) {
+ *        java.util.Calendar cal = DatatypeConverter.parseDateTime(dateTimeString);
+ *        long longval = convert_calendar_to_long(cal); //application specific
+ *        return longval;
+ *    }
+ *     
+ *    // Customized print method
+ *    public String myPrintCal( Long longval ) {
+ *        java.util.Calendar cal = convert_long_to_calendar(longval) ; //application specific
+ *        String dateTimeString = DatatypeConverter.printDateTime(cal);
+ *        return dateTimeString;
+ *    }
+ *    </pre>
+ * </blockquote>
+ * <p>
+ * There is a static parse and print method corresponding to each parse and 
+ * print method respectively in the {@link DatatypeConverterInterface 
+ * DatatypeConverterInterface}. 
+ * <p>
+ * The static methods defined in the class can also be used to specify
+ * a parse or a print method in a javaType binding declaration.
+ * </p>
+ * <p>
+ * JAXB Providers are required to call the 
+ * {@link #setDatatypeConverter(DatatypeConverterInterface) 
+ * setDatatypeConverter} api at some point before the first marshal or unmarshal 
+ * operation (perhaps during the call to JAXBContext.newInstance).  This step is 
+ * necessary to configure the converter that should be used to perform the 
+ * print and parse functionality.  
+ * </p>
+ * 
+ * <p>
+ * A print method for a XML schema datatype can output any lexical 
+ * representation that is valid with respect to the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException,
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ * </p>
+ * 
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @see DatatypeConverterInterface
+ * @see ParseConversionEvent
+ * @see PrintConversionEvent
+ * @since 1.6, JAXB 1.0
+ */
+
+final public class DatatypeConverter {
+
+    // delegate to this instance of DatatypeConverter
+    private static volatile DatatypeConverterInterface theConverter = null;
+
+    private final static JAXBPermission SET_DATATYPE_CONVERTER_PERMISSION =
+                           new JAXBPermission("setDatatypeConverter");
+
+    private DatatypeConverter() {
+        // private constructor
+    }
+    
+    /**
+     * This method is for JAXB provider use only.
+     * <p>
+     * JAXB Providers are required to call this method at some point before
+     * allowing any of the JAXB client marshal or unmarshal operations to
+     * occur.  This is necessary to configure the datatype converter that 
+     * should be used to perform the print and parse conversions.
+     * 
+     * <p>
+     * Calling this api repeatedly will have no effect - the 
+     * DatatypeConverterInterface instance passed into the first invocation is 
+     * the one that will be used from then on.
+     * 
+     * @param converter an instance of a class that implements the 
+     * DatatypeConverterInterface class - this parameter must not be null.
+     * @throws IllegalArgumentException if the parameter is null
+     * @throws SecurityException
+     *      If the {@link SecurityManager} in charge denies the access to
+     *      set the datatype converter. 
+     * @see JAXBPermission
+     */
+    public static void setDatatypeConverter( DatatypeConverterInterface converter ) {
+        if( converter == null ) {
+            throw new IllegalArgumentException( 
+                Messages.format( Messages.CONVERTER_MUST_NOT_BE_NULL ) );
+        } else if( theConverter == null ) {
+            SecurityManager sm = System.getSecurityManager();
+            if (sm != null)
+                sm.checkPermission(SET_DATATYPE_CONVERTER_PERMISSION);
+            theConverter = converter;
+        }
+    }
+
+    private static synchronized void initConverter() {
+        theConverter = new DatatypeConverterImpl();
+    }
+    
+    /**
+     * <p>
+     * Convert the lexical XSD string argument into a String value.
+     * @param lexicalXSDString
+     *     A string containing a lexical representation of
+     *     xsd:string.
+     * @return
+     *     A String value represented by the string argument.
+     */ 
+    public static String parseString( String lexicalXSDString ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseString( lexicalXSDString );
+    }
+
+    /**
+     * <p>
+     * Convert the string argument into a BigInteger value.
+     * @param lexicalXSDInteger
+     *     A string containing a lexical representation of
+     *     xsd:integer.
+     * @return
+     *     A BigInteger value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+     */ 
+    public static java.math.BigInteger parseInteger( String lexicalXSDInteger ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseInteger( lexicalXSDInteger );
+    }
+
+    /**
+     * <p>
+     * Convert the string argument into an int value.
+     * @param lexicalXSDInt
+     *     A string containing a lexical representation of
+     *     xsd:int.
+     * @return
+     *     A int value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+     */ 
+    public static int parseInt( String lexicalXSDInt ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseInt( lexicalXSDInt );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a long value.
+     * @param lexicalXSDLong
+     *     A string containing lexical representation of
+     *     xsd:long.
+     * @return
+     *     A long value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+     */ 
+    public static long parseLong( String lexicalXSDLong ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseLong( lexicalXSDLong );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a short value.
+     * @param lexicalXSDShort
+     *     A string containing lexical representation of
+     *     xsd:short.
+     * @return
+     *     A short value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+     */ 
+    public static short parseShort( String lexicalXSDShort ) { 
+        if (theConverter == null) initConverter();
+        return theConverter.parseShort( lexicalXSDShort );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a BigDecimal value.
+     * @param lexicalXSDDecimal
+     *     A string containing lexical representation of
+     *     xsd:decimal.
+     * @return
+     *     A BigDecimal value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+     */ 
+    public static java.math.BigDecimal parseDecimal( String lexicalXSDDecimal ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseDecimal( lexicalXSDDecimal );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a float value.
+     * @param lexicalXSDFloat
+     *     A string containing lexical representation of
+     *     xsd:float.
+     * @return
+     *     A float value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+     */ 
+    public static float parseFloat( String lexicalXSDFloat ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseFloat( lexicalXSDFloat );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a double value.
+     * @param lexicalXSDDouble
+     *     A string containing lexical representation of
+     *     xsd:double.
+     * @return
+     *     A double value represented by the string argument.
+     * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+     */ 
+    public static double parseDouble( String lexicalXSDDouble ) { 
+        if (theConverter == null) initConverter();
+        return theConverter.parseDouble( lexicalXSDDouble );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a boolean value.
+     * @param lexicalXSDBoolean
+     *     A string containing lexical representation of
+     *     xsd:boolean.
+     * @return
+     *     A boolean value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+     */ 
+    public static boolean parseBoolean( String lexicalXSDBoolean ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseBoolean( lexicalXSDBoolean );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a byte value.
+     * @param lexicalXSDByte
+     *     A string containing lexical representation of
+     *     xsd:byte.
+     * @return
+     *     A byte value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+     */ 
+    public static byte parseByte( String lexicalXSDByte ) { 
+        if (theConverter == null) initConverter();
+        return theConverter.parseByte( lexicalXSDByte );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a byte value.
+     *
+     * <p>
+     * String parameter {@code lexicalXSDQname} must conform to lexical value space specifed at
+     * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+     * 
+     * @param lexicalXSDQName
+     *     A string containing lexical representation of xsd:QName.
+     * @param nsc
+     *     A namespace context for interpreting a prefix within a QName.
+     * @return
+     *     A QName value represented by the string argument.
+     * @throws IllegalArgumentException  if string parameter does not conform to XML Schema Part 2 specification or 
+     *      if namespace prefix of {@code lexicalXSDQname} is not bound to a URI in NamespaceContext {@code nsc}.
+     */ 
+    public static javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+    				                    NamespaceContext nsc) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseQName( lexicalXSDQName, nsc );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a Calendar value.
+     * @param lexicalXSDDateTime
+     *     A string containing lexical representation of
+     *     xsd:datetime.
+     * @return
+     *     A Calendar object represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+     */ 
+    public static java.util.Calendar parseDateTime( String lexicalXSDDateTime ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseDateTime( lexicalXSDDateTime );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into an array of bytes.
+     * @param lexicalXSDBase64Binary
+     *     A string containing lexical representation
+     *     of xsd:base64Binary.
+     * @return
+     *     An array of bytes represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+     */ 
+    public static byte[] parseBase64Binary( String lexicalXSDBase64Binary ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseBase64Binary( lexicalXSDBase64Binary );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into an array of bytes.
+     * @param lexicalXSDHexBinary
+     *     A string containing lexical representation of
+     *     xsd:hexBinary.
+     * @return
+     *     An array of bytes represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+     */ 
+   public static byte[] parseHexBinary( String lexicalXSDHexBinary ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseHexBinary( lexicalXSDHexBinary );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a long value.
+     * @param lexicalXSDUnsignedInt
+     *     A string containing lexical representation
+     *     of xsd:unsignedInt.
+     * @return
+     *     A long value represented by the string argument.
+     * @throws NumberFormatException if string parameter can not be parsed into a {@code long} value.
+     */ 
+    public static long parseUnsignedInt( String lexicalXSDUnsignedInt ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseUnsignedInt( lexicalXSDUnsignedInt );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into an int value.
+     * @param lexicalXSDUnsignedShort
+     *     A string containing lexical
+     *     representation of xsd:unsignedShort.
+     * @return
+     *     An int value represented by the string argument.
+     * @throws NumberFormatException if string parameter can not be parsed into an {@code int} value.
+     */ 
+    public static int	parseUnsignedShort( String lexicalXSDUnsignedShort ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseUnsignedShort( lexicalXSDUnsignedShort );
+    }
+
+    /**
+     * <p>
+     * Converts the string argument into a Calendar value.
+     * @param lexicalXSDTime
+     *     A string containing lexical representation of
+     *     xsd:time.
+     * @return
+     *     A Calendar value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+     */ 
+    public static java.util.Calendar parseTime( String lexicalXSDTime ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseTime( lexicalXSDTime ); 
+    }
+    /**
+     * <p>
+     * Converts the string argument into a Calendar value.
+     * @param lexicalXSDDate
+     *      A string containing lexical representation of
+     *     xsd:Date.
+     * @return
+     *     A Calendar value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+     */ 
+    public static java.util.Calendar parseDate( String lexicalXSDDate ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseDate( lexicalXSDDate );
+    }
+
+    /**
+     * <p>
+     * Return a string containing the lexical representation of the 
+     * simple type.
+     * @param lexicalXSDAnySimpleType
+     *     A string containing lexical
+     *     representation of the simple type.
+     * @return
+     *     A string containing the lexical representation of the 
+     *     simple type.
+     */ 
+    public static String parseAnySimpleType( String lexicalXSDAnySimpleType ) {
+        if (theConverter == null) initConverter();
+        return theConverter.parseAnySimpleType( lexicalXSDAnySimpleType );
+    }
+    /**
+     * <p>
+     * Converts the string argument into a string.
+     * @param val
+     *     A string value.
+     * @return
+     *     A string containing a lexical representation of xsd:string.
+     */ 
+     // also indicate the print methods produce a lexical
+     // representation for given Java datatypes.
+	
+    public static String printString( String val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printString( val );
+    }
+
+    /**
+     * <p>
+     * Converts a BigInteger value into a string.
+     * @param val
+     *     A BigInteger value
+     * @return
+     *     A string containing a lexical representation of xsd:integer
+     * @throws IllegalArgumentException {@code val} is null.
+     */ 
+    public static String printInteger( java.math.BigInteger val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printInteger( val );
+    }
+
+    /**
+     * <p>
+     * Converts an int value into a string.
+     * @param val
+     *     An int value
+     * @return
+     *     A string containing a lexical representation of xsd:int
+     */ 
+    public static String printInt( int val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printInt( val );
+    }
+
+    /**
+     * <p>
+     * Converts A long value into a string.
+     * @param val
+     *     A long value
+     * @return
+     *     A string containing a lexical representation of xsd:long
+     */ 
+    public static String printLong( long val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printLong( val );
+    }
+
+    /**
+     * <p>
+     * Converts a short value into a string.
+     * @param val
+     *     A short value
+     * @return
+     *     A string containing a lexical representation of xsd:short
+     */ 
+    public static String printShort( short val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printShort( val );
+    }
+
+    /**
+     * <p>
+     * Converts a BigDecimal value into a string.
+     * @param val
+     *     A BigDecimal value
+     * @return
+     *     A string containing a lexical representation of xsd:decimal
+     * @throws IllegalArgumentException {@code val} is null.
+     */ 
+    public static String printDecimal( java.math.BigDecimal val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printDecimal( val );
+    }
+
+    /**
+     * <p>
+     * Converts a float value into a string.
+     * @param val
+     *     A float value
+     * @return
+     *     A string containing a lexical representation of xsd:float
+     */ 
+    public static String printFloat( float val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printFloat( val );
+    }
+
+    /**
+     * <p>
+     * Converts a double value into a string.
+     * @param val
+     *     A double value
+     * @return
+     *     A string containing a lexical representation of xsd:double
+     */ 
+    public static String printDouble( double val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printDouble( val );
+    }
+
+    /**
+     * <p>
+     * Converts a boolean value into a string.
+     * @param val
+     *     A boolean value
+     * @return
+     *     A string containing a lexical representation of xsd:boolean
+     */ 
+    public static String printBoolean( boolean val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printBoolean( val );
+    }
+
+    /**
+     * <p>
+     * Converts a byte value into a string.
+     * @param val
+     *     A byte value
+     * @return
+     *     A string containing a lexical representation of xsd:byte
+     */ 
+    public static String printByte( byte val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printByte( val );
+    }
+
+    /**
+     * <p>
+     * Converts a QName instance into a string.
+     * @param val
+     *     A QName value
+     * @param nsc
+     *     A namespace context for interpreting a prefix within a QName.
+     * @return
+     *     A string containing a lexical representation of QName
+     * @throws IllegalArgumentException if {@code val} is null or
+     * if {@code nsc} is non-null or {@code nsc.getPrefix(nsprefixFromVal)} is null.
+     */ 
+    public static String printQName( javax.xml.namespace.QName val,
+                                     NamespaceContext nsc ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printQName( val, nsc );
+    }
+
+    /**
+     * <p>
+     * Converts a Calendar value into a string.
+     * @param val
+     *     A Calendar value
+     * @return
+     *     A string containing a lexical representation of xsd:dateTime
+     * @throws IllegalArgumentException if {@code val} is null.
+     */ 
+    public static String printDateTime( java.util.Calendar val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printDateTime( val );
+    }
+
+    /**
+     * <p>
+     * Converts an array of bytes into a string.
+     * @param val
+     *     An array of bytes
+     * @return
+     *     A string containing a lexical representation of xsd:base64Binary
+     * @throws IllegalArgumentException if {@code val} is null.
+     */ 
+    public static String printBase64Binary( byte[] val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printBase64Binary( val );
+    }
+
+    /**
+     * <p>
+     * Converts an array of bytes into a string.
+     * @param val
+     *     An array of bytes
+     * @return
+     *     A string containing a lexical representation of xsd:hexBinary
+     * @throws IllegalArgumentException if {@code val} is null.
+     */ 
+    public static String printHexBinary( byte[] val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printHexBinary( val );
+    }
+
+    /**
+     * <p>
+     * Converts a long value into a string.
+     * @param val
+     *     A long value
+     * @return
+     *     A string containing a lexical representation of xsd:unsignedInt
+     */ 
+    public static String printUnsignedInt( long val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printUnsignedInt( val );
+    }
+
+    /**
+     * <p>
+     * Converts an int value into a string.
+     * @param val
+     *     An int value
+     * @return
+     *     A string containing a lexical representation of xsd:unsignedShort
+     */ 
+    public static String printUnsignedShort( int val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printUnsignedShort( val );
+    }
+
+    /**
+     * <p>
+     * Converts a Calendar value into a string.
+     * @param val
+     *     A Calendar value
+     * @return
+     *     A string containing a lexical representation of xsd:time
+     * @throws IllegalArgumentException if {@code val} is null.
+     */ 
+    public static String printTime( java.util.Calendar val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printTime( val );
+    }
+
+    /**
+     * <p>
+     * Converts a Calendar value into a string.
+     * @param val
+     *     A Calendar value
+     * @return
+     *     A string containing a lexical representation of xsd:date
+     * @throws IllegalArgumentException if {@code val} is null.
+     */ 
+    public static String printDate( java.util.Calendar val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printDate( val );
+    }
+
+    /**
+     * <p>
+     * Converts a string value into a string.
+     * @param val
+     *     A string value
+     * @return
+     *     A string containing a lexical representation of xsd:AnySimpleType
+     */ 
+    public static String printAnySimpleType( String val ) {
+        if (theConverter == null) initConverter();
+        return theConverter.printAnySimpleType( val );
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterImpl.java b/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterImpl.java
new file mode 100644
index 0000000..1072b52
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterImpl.java
@@ -0,0 +1,1027 @@
+/*
+ * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+
+import javax.xml.namespace.QName;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.DatatypeConfigurationException;
+
+/**
+ * This class is the JAXB RI's default implementation of the
+ * {@link DatatypeConverterInterface}.
+ *
+ * <p>
+ * When client applications specify the use of the static print/parse
+ * methods in {@link DatatypeConverter}, it will delegate
+ * to this class.
+ *
+ * <p>
+ * This class is responsible for whitespace normalization.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @since JAXB 2.1
+ */
+final class DatatypeConverterImpl implements DatatypeConverterInterface {
+
+    /**
+     * To avoid re-creating instances, we cache one instance.
+     */
+    public static final DatatypeConverterInterface theInstance = new DatatypeConverterImpl();
+
+    protected DatatypeConverterImpl() {
+    }
+
+    public String parseString(String lexicalXSDString) {
+        return lexicalXSDString;
+    }
+
+    public BigInteger parseInteger(String lexicalXSDInteger) {
+        return _parseInteger(lexicalXSDInteger);
+    }
+
+    public static BigInteger _parseInteger(CharSequence s) {
+        return new BigInteger(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
+    }
+
+    public String printInteger(BigInteger val) {
+        return _printInteger(val);
+    }
+
+    public static String _printInteger(BigInteger val) {
+        return val.toString();
+    }
+
+    public int parseInt(String s) {
+        return _parseInt(s);
+    }
+
+    /**
+     * Faster but less robust String->int conversion.
+     *
+     * Note that:
+     * <ol>
+     *  <li>XML Schema allows '+', but {@link Integer#valueOf(String)} is not.
+     *  <li>XML Schema allows leading and trailing (but not in-between) whitespaces.
+     *      {@link Integer#valueOf(String)} doesn't allow any.
+     * </ol>
+     */
+    public static int _parseInt(CharSequence s) {
+        int len = s.length();
+        int sign = 1;
+
+        int r = 0;
+
+        for (int i = 0; i < len; i++) {
+            char ch = s.charAt(i);
+            if (WhiteSpaceProcessor.isWhiteSpace(ch)) {
+                // skip whitespace
+            } else if ('0' <= ch && ch <= '9') {
+                r = r * 10 + (ch - '0');
+            } else if (ch == '-') {
+                sign = -1;
+            } else if (ch == '+') {
+                // noop
+            } else {
+                throw new NumberFormatException("Not a number: " + s);
+            }
+        }
+
+        return r * sign;
+    }
+
+    public long parseLong(String lexicalXSLong) {
+        return _parseLong(lexicalXSLong);
+    }
+
+    public static long _parseLong(CharSequence s) {
+        return Long.parseLong(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
+    }
+
+    public short parseShort(String lexicalXSDShort) {
+        return _parseShort(lexicalXSDShort);
+    }
+
+    public static short _parseShort(CharSequence s) {
+        return (short) _parseInt(s);
+    }
+
+    public String printShort(short val) {
+        return _printShort(val);
+    }
+
+    public static String _printShort(short val) {
+        return String.valueOf(val);
+    }
+
+    public BigDecimal parseDecimal(String content) {
+        return _parseDecimal(content);
+    }
+
+    public static BigDecimal _parseDecimal(CharSequence content) {
+        content = WhiteSpaceProcessor.trim(content);
+
+        if (content.length() <= 0) {
+            return null;
+        }
+
+        return new BigDecimal(content.toString());
+
+        // from purely XML Schema perspective,
+        // this implementation has a problem, since
+        // in xs:decimal "1.0" and "1" is equal whereas the above
+        // code will return different values for those two forms.
+        //
+        // the code was originally using com.sun.msv.datatype.xsd.NumberType.load,
+        // but a profiling showed that the process of normalizing "1.0" into "1"
+        // could take non-trivial time.
+        //
+        // also, from the user's point of view, one might be surprised if
+        // 1 (not 1.0) is returned from "1.000"
+    }
+
+    public float parseFloat(String lexicalXSDFloat) {
+        return _parseFloat(lexicalXSDFloat);
+    }
+
+    public static float _parseFloat(CharSequence _val) {
+        String s = WhiteSpaceProcessor.trim(_val).toString();
+        /* Incompatibilities of XML Schema's float "xfloat" and Java's float "jfloat"
+
+         * jfloat.valueOf ignores leading and trailing whitespaces,
+        whereas this is not allowed in xfloat.
+         * jfloat.valueOf allows "float type suffix" (f, F) to be
+        appended after float literal (e.g., 1.52e-2f), whereare
+        this is not the case of xfloat.
+
+        gray zone
+        ---------
+         * jfloat allows ".523". And there is no clear statement that mentions
+        this case in xfloat. Although probably this is allowed.
+         *
+         */
+
+        if (s.equals("NaN")) {
+            return Float.NaN;
+        }
+        if (s.equals("INF")) {
+            return Float.POSITIVE_INFINITY;
+        }
+        if (s.equals("-INF")) {
+            return Float.NEGATIVE_INFINITY;
+        }
+
+        if (s.length() == 0
+                || !isDigitOrPeriodOrSign(s.charAt(0))
+                || !isDigitOrPeriodOrSign(s.charAt(s.length() - 1))) {
+            throw new NumberFormatException();
+        }
+
+        // these screening process is necessary due to the wobble of Float.valueOf method
+        return Float.parseFloat(s);
+    }
+
+    public String printFloat(float v) {
+        return _printFloat(v);
+    }
+
+    public static String _printFloat(float v) {
+        if (Float.isNaN(v)) {
+            return "NaN";
+        }
+        if (v == Float.POSITIVE_INFINITY) {
+            return "INF";
+        }
+        if (v == Float.NEGATIVE_INFINITY) {
+            return "-INF";
+        }
+        return String.valueOf(v);
+    }
+
+    public double parseDouble(String lexicalXSDDouble) {
+        return _parseDouble(lexicalXSDDouble);
+    }
+
+    public static double _parseDouble(CharSequence _val) {
+        String val = WhiteSpaceProcessor.trim(_val).toString();
+
+        if (val.equals("NaN")) {
+            return Double.NaN;
+        }
+        if (val.equals("INF")) {
+            return Double.POSITIVE_INFINITY;
+        }
+        if (val.equals("-INF")) {
+            return Double.NEGATIVE_INFINITY;
+        }
+
+        if (val.length() == 0
+                || !isDigitOrPeriodOrSign(val.charAt(0))
+                || !isDigitOrPeriodOrSign(val.charAt(val.length() - 1))) {
+            throw new NumberFormatException(val);
+        }
+
+
+        // these screening process is necessary due to the wobble of Float.valueOf method
+        return Double.parseDouble(val);
+    }
+
+    public boolean parseBoolean(String lexicalXSDBoolean) {
+        Boolean b = _parseBoolean(lexicalXSDBoolean);
+        return (b == null) ? false : b.booleanValue();
+    }
+
+    public static Boolean _parseBoolean(CharSequence literal) {
+        if (literal == null) {
+            return null;
+        }
+
+        int i = 0;
+        int len = literal.length();
+        char ch;
+        boolean value = false;
+
+        if (literal.length() <= 0) {
+            return null;
+        }
+
+        do {
+            ch = literal.charAt(i++);
+        } while (WhiteSpaceProcessor.isWhiteSpace(ch) && i < len);
+
+        int strIndex = 0;
+
+        switch (ch) {
+            case '1':
+                value = true;
+                break;
+            case '0':
+                value = false;
+                break;
+            case 't':
+                String strTrue = "rue";
+                do {
+                    ch = literal.charAt(i++);
+                } while ((strTrue.charAt(strIndex++) == ch) && i < len && strIndex < 3);
+
+                if (strIndex == 3) {
+                    value = true;
+                } else {
+                    return false;
+                }
+//                    throw new IllegalArgumentException("String \"" + literal + "\" is not valid boolean value.");
+
+                break;
+            case 'f':
+                String strFalse = "alse";
+                do {
+                    ch = literal.charAt(i++);
+                } while ((strFalse.charAt(strIndex++) == ch) && i < len && strIndex < 4);
+
+
+                if (strIndex == 4) {
+                    value = false;
+                } else {
+                    return false;
+                }
+//                    throw new IllegalArgumentException("String \"" + literal + "\" is not valid boolean value.");
+
+                break;
+        }
+
+        if (i < len) {
+            do {
+                ch = literal.charAt(i++);
+            } while (WhiteSpaceProcessor.isWhiteSpace(ch) && i < len);
+        }
+
+        if (i == len) {
+            return value;
+        } else {
+            return null;
+        }
+//            throw new IllegalArgumentException("String \"" + literal + "\" is not valid boolean value.");
+    }
+
+    public String printBoolean(boolean val) {
+        return val ? "true" : "false";
+    }
+
+    public static String _printBoolean(boolean val) {
+        return val ? "true" : "false";
+    }
+
+    public byte parseByte(String lexicalXSDByte) {
+        return _parseByte(lexicalXSDByte);
+    }
+
+    public static byte _parseByte(CharSequence literal) {
+        return (byte) _parseInt(literal);
+    }
+
+    public String printByte(byte val) {
+        return _printByte(val);
+    }
+
+    public static String _printByte(byte val) {
+        return String.valueOf(val);
+    }
+
+    public QName parseQName(String lexicalXSDQName, NamespaceContext nsc) {
+        return _parseQName(lexicalXSDQName, nsc);
+    }
+
+    /**
+     * @return null if fails to convert.
+     */
+    public static QName _parseQName(CharSequence text, NamespaceContext nsc) {
+        int length = text.length();
+
+        // trim whitespace
+        int start = 0;
+        while (start < length && WhiteSpaceProcessor.isWhiteSpace(text.charAt(start))) {
+            start++;
+        }
+
+        int end = length;
+        while (end > start && WhiteSpaceProcessor.isWhiteSpace(text.charAt(end - 1))) {
+            end--;
+        }
+
+        if (end == start) {
+            throw new IllegalArgumentException("input is empty");
+        }
+
+
+        String uri;
+        String localPart;
+        String prefix;
+
+        // search ':'
+        int idx = start + 1;    // no point in searching the first char. that's not valid.
+        while (idx < end && text.charAt(idx) != ':') {
+            idx++;
+        }
+
+        if (idx == end) {
+            uri = nsc.getNamespaceURI("");
+            localPart = text.subSequence(start, end).toString();
+            prefix = "";
+        } else {
+            // Prefix exists, check everything
+            prefix = text.subSequence(start, idx).toString();
+            localPart = text.subSequence(idx + 1, end).toString();
+            uri = nsc.getNamespaceURI(prefix);
+            // uri can never be null according to javadoc,
+            // but some users reported that there are implementations that return null.
+            if (uri == null || uri.length() == 0) // crap. the NamespaceContext interface is broken.
+            // error: unbound prefix
+            {
+                throw new IllegalArgumentException("prefix " + prefix + " is not bound to a namespace");
+            }
+        }
+
+        return new QName(uri, localPart, prefix);
+    }
+
+    public Calendar parseDateTime(String lexicalXSDDateTime) {
+        return _parseDateTime(lexicalXSDDateTime);
+    }
+
+    public static GregorianCalendar _parseDateTime(CharSequence s) {
+        String val = WhiteSpaceProcessor.trim(s).toString();
+        return datatypeFactory.newXMLGregorianCalendar(val).toGregorianCalendar();
+    }
+
+    public String printDateTime(Calendar val) {
+        return _printDateTime(val);
+    }
+
+    public static String _printDateTime(Calendar val) {
+        return CalendarFormatter.doFormat("%Y-%M-%DT%h:%m:%s%z", val);
+    }
+
+    public byte[] parseBase64Binary(String lexicalXSDBase64Binary) {
+        return _parseBase64Binary(lexicalXSDBase64Binary);
+    }
+
+    public byte[] parseHexBinary(String s) {
+        final int len = s.length();
+
+        // "111" is not a valid hex encoding.
+        if (len % 2 != 0) {
+            throw new IllegalArgumentException("hexBinary needs to be even-length: " + s);
+        }
+
+        byte[] out = new byte[len / 2];
+
+        for (int i = 0; i < len; i += 2) {
+            int h = hexToBin(s.charAt(i));
+            int l = hexToBin(s.charAt(i + 1));
+            if (h == -1 || l == -1) {
+                throw new IllegalArgumentException("contains illegal character for hexBinary: " + s);
+            }
+
+            out[i / 2] = (byte) (h * 16 + l);
+        }
+
+        return out;
+    }
+
+    private static int hexToBin(char ch) {
+        if ('0' <= ch && ch <= '9') {
+            return ch - '0';
+        }
+        if ('A' <= ch && ch <= 'F') {
+            return ch - 'A' + 10;
+        }
+        if ('a' <= ch && ch <= 'f') {
+            return ch - 'a' + 10;
+        }
+        return -1;
+    }
+    private static final char[] hexCode = "0123456789ABCDEF".toCharArray();
+
+    public String printHexBinary(byte[] data) {
+        StringBuilder r = new StringBuilder(data.length * 2);
+        for (byte b : data) {
+            r.append(hexCode[(b >> 4) & 0xF]);
+            r.append(hexCode[(b & 0xF)]);
+        }
+        return r.toString();
+    }
+
+    public long parseUnsignedInt(String lexicalXSDUnsignedInt) {
+        return _parseLong(lexicalXSDUnsignedInt);
+    }
+
+    public String printUnsignedInt(long val) {
+        return _printLong(val);
+    }
+
+    public int parseUnsignedShort(String lexicalXSDUnsignedShort) {
+        return _parseInt(lexicalXSDUnsignedShort);
+    }
+
+    public Calendar parseTime(String lexicalXSDTime) {
+        return datatypeFactory.newXMLGregorianCalendar(lexicalXSDTime).toGregorianCalendar();
+    }
+
+    public String printTime(Calendar val) {
+        return CalendarFormatter.doFormat("%h:%m:%s%z", val);
+    }
+
+    public Calendar parseDate(String lexicalXSDDate) {
+        return datatypeFactory.newXMLGregorianCalendar(lexicalXSDDate).toGregorianCalendar();
+    }
+
+    public String printDate(Calendar val) {
+        return _printDate(val);
+    }
+
+    public static String _printDate(Calendar val) {
+        return CalendarFormatter.doFormat((new StringBuilder("%Y-%M-%D").append("%z")).toString(),val);
+    }
+
+    public String parseAnySimpleType(String lexicalXSDAnySimpleType) {
+        return lexicalXSDAnySimpleType;
+//        return (String)SimpleURType.theInstance._createValue( lexicalXSDAnySimpleType, null );
+    }
+
+    public String printString(String val) {
+//        return StringType.theInstance.convertToLexicalValue( val, null );
+        return val;
+    }
+
+    public String printInt(int val) {
+        return _printInt(val);
+    }
+
+    public static String _printInt(int val) {
+        return String.valueOf(val);
+    }
+
+    public String printLong(long val) {
+        return _printLong(val);
+    }
+
+    public static String _printLong(long val) {
+        return String.valueOf(val);
+    }
+
+    public String printDecimal(BigDecimal val) {
+        return _printDecimal(val);
+    }
+
+    public static String _printDecimal(BigDecimal val) {
+        return val.toPlainString();
+    }
+
+    public String printDouble(double v) {
+        return _printDouble(v);
+    }
+
+    public static String _printDouble(double v) {
+        if (Double.isNaN(v)) {
+            return "NaN";
+        }
+        if (v == Double.POSITIVE_INFINITY) {
+            return "INF";
+        }
+        if (v == Double.NEGATIVE_INFINITY) {
+            return "-INF";
+        }
+        return String.valueOf(v);
+    }
+
+    public String printQName(QName val, NamespaceContext nsc) {
+        return _printQName(val, nsc);
+    }
+
+    public static String _printQName(QName val, NamespaceContext nsc) {
+        // Double-check
+        String qname;
+        String prefix = nsc.getPrefix(val.getNamespaceURI());
+        String localPart = val.getLocalPart();
+
+        if (prefix == null || prefix.length() == 0) { // be defensive
+            qname = localPart;
+        } else {
+            qname = prefix + ':' + localPart;
+        }
+
+        return qname;
+    }
+
+    public String printBase64Binary(byte[] val) {
+        return _printBase64Binary(val);
+    }
+
+    public String printUnsignedShort(int val) {
+        return String.valueOf(val);
+    }
+
+    public String printAnySimpleType(String val) {
+        return val;
+    }
+
+    /**
+     * Just return the string passed as a parameter but
+     * installs an instance of this class as the DatatypeConverter
+     * implementation. Used from static fixed value initializers.
+     */
+    public static String installHook(String s) {
+        DatatypeConverter.setDatatypeConverter(theInstance);
+        return s;
+    }
+// base64 decoder
+    private static final byte[] decodeMap = initDecodeMap();
+    private static final byte PADDING = 127;
+
+    private static byte[] initDecodeMap() {
+        byte[] map = new byte[128];
+        int i;
+        for (i = 0; i < 128; i++) {
+            map[i] = -1;
+        }
+
+        for (i = 'A'; i <= 'Z'; i++) {
+            map[i] = (byte) (i - 'A');
+        }
+        for (i = 'a'; i <= 'z'; i++) {
+            map[i] = (byte) (i - 'a' + 26);
+        }
+        for (i = '0'; i <= '9'; i++) {
+            map[i] = (byte) (i - '0' + 52);
+        }
+        map['+'] = 62;
+        map['/'] = 63;
+        map['='] = PADDING;
+
+        return map;
+    }
+
+    /**
+     * computes the length of binary data speculatively.
+     *
+     * <p>
+     * Our requirement is to create byte[] of the exact length to store the binary data.
+     * If we do this in a straight-forward way, it takes two passes over the data.
+     * Experiments show that this is a non-trivial overhead (35% or so is spent on
+     * the first pass in calculating the length.)
+     *
+     * <p>
+     * So the approach here is that we compute the length speculatively, without looking
+     * at the whole contents. The obtained speculative value is never less than the
+     * actual length of the binary data, but it may be bigger. So if the speculation
+     * goes wrong, we'll pay the cost of reallocation and buffer copying.
+     *
+     * <p>
+     * If the base64 text is tightly packed with no indentation nor illegal char
+     * (like what most web services produce), then the speculation of this method
+     * will be correct, so we get the performance benefit.
+     */
+    private static int guessLength(String text) {
+        final int len = text.length();
+
+        // compute the tail '=' chars
+        int j = len - 1;
+        for (; j >= 0; j--) {
+            byte code = decodeMap[text.charAt(j)];
+            if (code == PADDING) {
+                continue;
+            }
+            if (code == -1) // most likely this base64 text is indented. go with the upper bound
+            {
+                return text.length() / 4 * 3;
+            }
+            break;
+        }
+
+        j++;    // text.charAt(j) is now at some base64 char, so +1 to make it the size
+        int padSize = len - j;
+        if (padSize > 2) // something is wrong with base64. be safe and go with the upper bound
+        {
+            return text.length() / 4 * 3;
+        }
+
+        // so far this base64 looks like it's unindented tightly packed base64.
+        // take a chance and create an array with the expected size
+        return text.length() / 4 * 3 - padSize;
+    }
+
+    /**
+     * @param text
+     *      base64Binary data is likely to be long, and decoding requires
+     *      each character to be accessed twice (once for counting length, another
+     *      for decoding.)
+     *
+     *      A benchmark showed that taking {@link String} is faster, presumably
+     *      because JIT can inline a lot of string access (with data of 1K chars, it was twice as fast)
+     */
+    public static byte[] _parseBase64Binary(String text) {
+        final int buflen = guessLength(text);
+        final byte[] out = new byte[buflen];
+        int o = 0;
+
+        final int len = text.length();
+        int i;
+
+        final byte[] quadruplet = new byte[4];
+        int q = 0;
+
+        // convert each quadruplet to three bytes.
+        for (i = 0; i < len; i++) {
+            char ch = text.charAt(i);
+            byte v = decodeMap[ch];
+
+            if (v != -1) {
+                quadruplet[q++] = v;
+            }
+
+            if (q == 4) {
+                // quadruplet is now filled.
+                out[o++] = (byte) ((quadruplet[0] << 2) | (quadruplet[1] >> 4));
+                if (quadruplet[2] != PADDING) {
+                    out[o++] = (byte) ((quadruplet[1] << 4) | (quadruplet[2] >> 2));
+                }
+                if (quadruplet[3] != PADDING) {
+                    out[o++] = (byte) ((quadruplet[2] << 6) | (quadruplet[3]));
+                }
+                q = 0;
+            }
+        }
+
+        if (buflen == o) // speculation worked out to be OK
+        {
+            return out;
+        }
+
+        // we overestimated, so need to create a new buffer
+        byte[] nb = new byte[o];
+        System.arraycopy(out, 0, nb, 0, o);
+        return nb;
+    }
+    private static final char[] encodeMap = initEncodeMap();
+
+    private static char[] initEncodeMap() {
+        char[] map = new char[64];
+        int i;
+        for (i = 0; i < 26; i++) {
+            map[i] = (char) ('A' + i);
+        }
+        for (i = 26; i < 52; i++) {
+            map[i] = (char) ('a' + (i - 26));
+        }
+        for (i = 52; i < 62; i++) {
+            map[i] = (char) ('0' + (i - 52));
+        }
+        map[62] = '+';
+        map[63] = '/';
+
+        return map;
+    }
+
+    public static char encode(int i) {
+        return encodeMap[i & 0x3F];
+    }
+
+    public static byte encodeByte(int i) {
+        return (byte) encodeMap[i & 0x3F];
+    }
+
+    public static String _printBase64Binary(byte[] input) {
+        return _printBase64Binary(input, 0, input.length);
+    }
+
+    public static String _printBase64Binary(byte[] input, int offset, int len) {
+        char[] buf = new char[((len + 2) / 3) * 4];
+        int ptr = _printBase64Binary(input, offset, len, buf, 0);
+        assert ptr == buf.length;
+        return new String(buf);
+    }
+
+    /**
+     * Encodes a byte array into a char array by doing base64 encoding.
+     *
+     * The caller must supply a big enough buffer.
+     *
+     * @return
+     *      the value of {@code ptr+((len+2)/3)*4}, which is the new offset
+     *      in the output buffer where the further bytes should be placed.
+     */
+    public static int _printBase64Binary(byte[] input, int offset, int len, char[] buf, int ptr) {
+        // encode elements until only 1 or 2 elements are left to encode
+        int remaining = len;
+        int i;
+        for (i = offset;remaining >= 3; remaining -= 3, i += 3) {
+            buf[ptr++] = encode(input[i] >> 2);
+            buf[ptr++] = encode(
+                    ((input[i] & 0x3) << 4)
+                    | ((input[i + 1] >> 4) & 0xF));
+            buf[ptr++] = encode(
+                    ((input[i + 1] & 0xF) << 2)
+                    | ((input[i + 2] >> 6) & 0x3));
+            buf[ptr++] = encode(input[i + 2] & 0x3F);
+        }
+        // encode when exactly 1 element (left) to encode
+        if (remaining == 1) {
+            buf[ptr++] = encode(input[i] >> 2);
+            buf[ptr++] = encode(((input[i]) & 0x3) << 4);
+            buf[ptr++] = '=';
+            buf[ptr++] = '=';
+        }
+        // encode when exactly 2 elements (left) to encode
+        if (remaining == 2) {
+            buf[ptr++] = encode(input[i] >> 2);
+            buf[ptr++] = encode(((input[i] & 0x3) << 4)
+                    | ((input[i + 1] >> 4) & 0xF));
+            buf[ptr++] = encode((input[i + 1] & 0xF) << 2);
+            buf[ptr++] = '=';
+        }
+        return ptr;
+    }
+
+    /**
+     * Encodes a byte array into another byte array by first doing base64 encoding
+     * then encoding the result in ASCII.
+     *
+     * The caller must supply a big enough buffer.
+     *
+     * @return
+     *      the value of {@code ptr+((len+2)/3)*4}, which is the new offset
+     *      in the output buffer where the further bytes should be placed.
+     */
+    public static int _printBase64Binary(byte[] input, int offset, int len, byte[] out, int ptr) {
+        byte[] buf = out;
+        int remaining = len;
+        int i;
+        for (i=offset; remaining >= 3; remaining -= 3, i += 3 ) {
+            buf[ptr++] = encodeByte(input[i]>>2);
+            buf[ptr++] = encodeByte(
+                        ((input[i]&0x3)<<4) |
+                        ((input[i+1]>>4)&0xF));
+            buf[ptr++] = encodeByte(
+                        ((input[i+1]&0xF)<<2)|
+                        ((input[i+2]>>6)&0x3));
+            buf[ptr++] = encodeByte(input[i+2]&0x3F);
+        }
+        // encode when exactly 1 element (left) to encode
+        if (remaining == 1) {
+            buf[ptr++] = encodeByte(input[i]>>2);
+            buf[ptr++] = encodeByte(((input[i])&0x3)<<4);
+            buf[ptr++] = '=';
+            buf[ptr++] = '=';
+        }
+        // encode when exactly 2 elements (left) to encode
+        if (remaining == 2) {
+            buf[ptr++] = encodeByte(input[i]>>2);
+            buf[ptr++] = encodeByte(
+                        ((input[i]&0x3)<<4) |
+                        ((input[i+1]>>4)&0xF));
+            buf[ptr++] = encodeByte((input[i+1]&0xF)<<2);
+            buf[ptr++] = '=';
+        }
+
+        return ptr;
+    }
+
+    private static CharSequence removeOptionalPlus(CharSequence s) {
+        int len = s.length();
+
+        if (len <= 1 || s.charAt(0) != '+') {
+            return s;
+        }
+
+        s = s.subSequence(1, len);
+        char ch = s.charAt(0);
+        if ('0' <= ch && ch <= '9') {
+            return s;
+        }
+        if ('.' == ch) {
+            return s;
+        }
+
+        throw new NumberFormatException();
+    }
+
+    private static boolean isDigitOrPeriodOrSign(char ch) {
+        if ('0' <= ch && ch <= '9') {
+            return true;
+        }
+        if (ch == '+' || ch == '-' || ch == '.') {
+            return true;
+        }
+        return false;
+    }
+    private static final DatatypeFactory datatypeFactory;
+
+    static {
+        try {
+            datatypeFactory = DatatypeFactory.newInstance();
+        } catch (DatatypeConfigurationException e) {
+            throw new Error(e);
+        }
+    }
+
+    private static final class CalendarFormatter {
+
+        public static String doFormat(String format, Calendar cal) throws IllegalArgumentException {
+            int fidx = 0;
+            int flen = format.length();
+            StringBuilder buf = new StringBuilder();
+
+            while (fidx < flen) {
+                char fch = format.charAt(fidx++);
+
+                if (fch != '%') {  // not a meta character
+                    buf.append(fch);
+                    continue;
+                }
+
+                // seen meta character. we don't do error check against the format
+                switch (format.charAt(fidx++)) {
+                    case 'Y': // year
+                        formatYear(cal, buf);
+                        break;
+
+                    case 'M': // month
+                        formatMonth(cal, buf);
+                        break;
+
+                    case 'D': // days
+                        formatDays(cal, buf);
+                        break;
+
+                    case 'h': // hours
+                        formatHours(cal, buf);
+                        break;
+
+                    case 'm': // minutes
+                        formatMinutes(cal, buf);
+                        break;
+
+                    case 's': // parse seconds.
+                        formatSeconds(cal, buf);
+                        break;
+
+                    case 'z': // time zone
+                        formatTimeZone(cal, buf);
+                        break;
+
+                    default:
+                        // illegal meta character. impossible.
+                        throw new InternalError();
+                }
+            }
+
+            return buf.toString();
+        }
+
+        private static void formatYear(Calendar cal, StringBuilder buf) {
+            int year = cal.get(Calendar.YEAR);
+
+            String s;
+            if (year <= 0) // negative value
+            {
+                s = Integer.toString(1 - year);
+            } else // positive value
+            {
+                s = Integer.toString(year);
+            }
+
+            while (s.length() < 4) {
+                s = '0' + s;
+            }
+            if (year <= 0) {
+                s = '-' + s;
+            }
+
+            buf.append(s);
+        }
+
+        private static void formatMonth(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.MONTH) + 1, buf);
+        }
+
+        private static void formatDays(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.DAY_OF_MONTH), buf);
+        }
+
+        private static void formatHours(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.HOUR_OF_DAY), buf);
+        }
+
+        private static void formatMinutes(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.MINUTE), buf);
+        }
+
+        private static void formatSeconds(Calendar cal, StringBuilder buf) {
+            formatTwoDigits(cal.get(Calendar.SECOND), buf);
+            if (cal.isSet(Calendar.MILLISECOND)) { // milliseconds
+                int n = cal.get(Calendar.MILLISECOND);
+                if (n != 0) {
+                    String ms = Integer.toString(n);
+                    while (ms.length() < 3) {
+                        ms = '0' + ms; // left 0 paddings.
+                    }
+                    buf.append('.');
+                    buf.append(ms);
+                }
+            }
+        }
+
+        /** formats time zone specifier. */
+        private static void formatTimeZone(Calendar cal, StringBuilder buf) {
+            TimeZone tz = cal.getTimeZone();
+
+            if (tz == null) {
+                return;
+            }
+
+            // otherwise print out normally.
+            int offset = tz.getOffset(cal.getTime().getTime());
+
+            if (offset == 0) {
+                buf.append('Z');
+                return;
+            }
+
+            if (offset >= 0) {
+                buf.append('+');
+            } else {
+                buf.append('-');
+                offset *= -1;
+            }
+
+            offset /= 60 * 1000; // offset is in milli-seconds
+
+            formatTwoDigits(offset / 60, buf);
+            buf.append(':');
+            formatTwoDigits(offset % 60, buf);
+        }
+
+        /** formats Integer into two-character-wide string. */
+        private static void formatTwoDigits(int n, StringBuilder buf) {
+            // n is always non-negative.
+            if (n < 10) {
+                buf.append('0');
+            }
+            buf.append(n);
+        }
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java b/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
new file mode 100644
index 0000000..80d661a
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
@@ -0,0 +1,469 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * <p>
+ * The DatatypeConverterInterface is for JAXB provider use only. A
+ * JAXB provider must supply a class that implements this interface.
+ * JAXB Providers are required to call the
+ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
+ * DatatypeConverter.setDatatypeConverter} api at
+ * some point before the first marshal or unmarshal operation (perhaps during
+ * the call to JAXBContext.newInstance).  This step is necessary to configure
+ * the converter that should be used to perform the print and parse
+ * functionality.  Calling this api repeatedly will have no effect - the
+ * DatatypeConverter instance passed into the first invocation is the one that
+ * will be used from then on.
+ *
+ * <p>
+ * This interface defines the parse and print methods. There is one
+ * parse and print method for each XML schema datatype specified in the
+ * the default binding Table 5-1 in the JAXB specification.
+ *
+ * <p>
+ * The parse and print methods defined here are invoked by the static parse
+ * and print methods defined in the {@link DatatypeConverter DatatypeConverter}
+ * class.
+ *
+ * <p>
+ * A parse method for a XML schema datatype must be capable of converting any
+ * lexical representation of the XML schema datatype ( specified by the
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification</a> into a value in the value space of the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ *
+ * <p>
+ * A print method for a XML schema datatype can output any lexical
+ * representation that is valid with respect to the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException,
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ *
+ * <p>
+ * The prefix xsd: is used to refer to XML schema datatypes
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification.</a>
+ *
+ * @author <ul>
+ *         <li>Sekhar Vajjhala, Sun Microsystems, Inc.</li>
+ *         <li>Joe Fialli, Sun Microsystems Inc.</li>
+ *         <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ *         <li>Ryan Shoemaker,Sun Microsystems Inc.</li>
+ *         </ul>
+ * @see DatatypeConverter
+ * @see ParseConversionEvent
+ * @see PrintConversionEvent
+ * @since 1.6, JAXB 1.0
+ */
+
+public interface DatatypeConverterInterface {
+    /**
+     * Convert the string argument into a string.
+     * @param lexicalXSDString
+     *     A lexical representation of the XML Schema datatype xsd:string
+     * @return
+     *     A string that is the same as the input string.
+     */
+    public String parseString( String lexicalXSDString );
+
+    /**
+     * Convert the string argument into a BigInteger value.
+     * @param lexicalXSDInteger
+     *     A string containing a lexical representation of
+     *     xsd:integer.
+     * @return
+     *     A BigInteger value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDInteger} is not a valid string representation of a {@link java.math.BigInteger} value.
+     */
+    public java.math.BigInteger parseInteger( String lexicalXSDInteger );
+
+    /**
+     * Convert the string argument into an int value.
+     * @param lexicalXSDInt
+     *     A string containing a lexical representation of
+     *     xsd:int.
+     * @return
+     *     An int value represented byte the string argument.
+     * @throws NumberFormatException {@code lexicalXSDInt} is not a valid string representation of an {@code int} value.
+     */
+    public int parseInt( String lexicalXSDInt );
+
+    /**
+     * Converts the string argument into a long value.
+     * @param lexicalXSDLong
+     *     A string containing lexical representation of
+     *     xsd:long.
+     * @return
+     *     A long value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDLong} is not a valid string representation of a {@code long} value.
+     */
+    public long parseLong( String lexicalXSDLong );
+
+    /**
+     * Converts the string argument into a short value.
+     * @param lexicalXSDShort
+     *     A string containing lexical representation of
+     *     xsd:short.
+     * @return
+     *     A short value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDShort} is not a valid string representation of a {@code short} value.
+     */
+    public short parseShort( String lexicalXSDShort );
+
+    /**
+     * Converts the string argument into a BigDecimal value.
+     * @param lexicalXSDDecimal
+     *     A string containing lexical representation of
+     *     xsd:decimal.
+     * @return
+     *     A BigDecimal value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDDecimal} is not a valid string representation of {@link java.math.BigDecimal}.
+     */
+    public java.math.BigDecimal parseDecimal( String lexicalXSDDecimal );
+
+    /**
+     * Converts the string argument into a float value.
+     * @param lexicalXSDFloat
+     *     A string containing lexical representation of
+     *     xsd:float.
+     * @return
+     *     A float value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDFloat} is not a valid string representation of a {@code float} value.
+     */
+    public float parseFloat( String lexicalXSDFloat );
+
+    /**
+     * Converts the string argument into a double value.
+     * @param lexicalXSDDouble
+     *     A string containing lexical representation of
+     *     xsd:double.
+     * @return
+     *     A double value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDDouble} is not a valid string representation of a {@code double} value.
+     */
+    public double parseDouble( String lexicalXSDDouble );
+
+    /**
+     * Converts the string argument into a boolean value.
+     * @param lexicalXSDBoolean
+     *     A string containing lexical representation of
+     *     xsd:boolean.
+     * @return
+     *     A boolean value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+     */
+    public boolean parseBoolean( String lexicalXSDBoolean );
+
+    /**
+     * Converts the string argument into a byte value.
+     * @param lexicalXSDByte
+     *     A string containing lexical representation of
+     *     xsd:byte.
+     * @return
+     *     A byte value represented by the string argument.
+     * @throws NumberFormatException {@code lexicalXSDByte} does not contain a parseable byte.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+     */
+    public byte parseByte( String lexicalXSDByte );
+
+    /**
+     * Converts the string argument into a QName value.
+     *
+     * <p>
+     * String parameter {@code lexicalXSDQname} must conform to lexical value space specifed at
+     * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+     *
+     * @param lexicalXSDQName
+     *     A string containing lexical representation of xsd:QName.
+     * @param nsc
+     *     A namespace context for interpreting a prefix within a QName.
+     * @return
+     *     A QName value represented by the string argument.
+     * @throws IllegalArgumentException  if string parameter does not conform to XML Schema Part 2 specification or
+     *      if namespace prefix of {@code lexicalXSDQname} is not bound to a URI in NamespaceContext {@code nsc}.
+     */
+    public javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+                                                 javax.xml.namespace.NamespaceContext nsc);
+
+    /**
+     * Converts the string argument into a Calendar value.
+     * @param lexicalXSDDateTime
+     *     A string containing lexical representation of
+     *     xsd:datetime.
+     * @return
+     *     A Calendar object represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+     */
+    public java.util.Calendar parseDateTime( String lexicalXSDDateTime );
+
+    /**
+     * Converts the string argument into an array of bytes.
+     * @param lexicalXSDBase64Binary
+     *     A string containing lexical representation
+     *     of xsd:base64Binary.
+     * @return
+     *     An array of bytes represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+     */
+    public byte[] parseBase64Binary( String lexicalXSDBase64Binary );
+
+    /**
+     * Converts the string argument into an array of bytes.
+     * @param lexicalXSDHexBinary
+     *     A string containing lexical representation of
+     *     xsd:hexBinary.
+     * @return
+     *     An array of bytes represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+     */
+    public byte[] parseHexBinary( String lexicalXSDHexBinary );
+
+    /**
+     * Converts the string argument into a long value.
+     * @param lexicalXSDUnsignedInt
+     *     A string containing lexical representation
+     *     of xsd:unsignedInt.
+     * @return
+     *     A long value represented by the string argument.
+     * @throws NumberFormatException if string parameter can not be parsed into a {@code long} value.
+     */
+    public long parseUnsignedInt( String lexicalXSDUnsignedInt );
+
+    /**
+     * Converts the string argument into an int value.
+     * @param lexicalXSDUnsignedShort
+     *     A string containing lexical
+     *     representation of xsd:unsignedShort.
+     * @return
+     *     An int value represented by the string argument.
+     * @throws NumberFormatException if string parameter can not be parsed into an {@code int} value.
+     */
+    public int parseUnsignedShort( String lexicalXSDUnsignedShort );
+
+    /**
+     * Converts the string argument into a Calendar value.
+     * @param lexicalXSDTime
+     *     A string containing lexical representation of
+     *     xsd:Time.
+     * @return
+     *     A Calendar value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+     */
+    public java.util.Calendar parseTime( String lexicalXSDTime );
+
+    /**
+     * Converts the string argument into a Calendar value.
+     * @param lexicalXSDDate
+     *     A string containing lexical representation of
+     *     xsd:Date.
+     * @return
+     *     A Calendar value represented by the string argument.
+     * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+     */
+    public java.util.Calendar parseDate( String lexicalXSDDate );
+
+    /**
+     * Return a string containing the lexical representation of the
+     * simple type.
+     * @param lexicalXSDAnySimpleType
+     *     A string containing lexical
+     *     representation of the simple type.
+     * @return
+     *     A string containing the lexical representation of the
+     *     simple type.
+     */
+    public String parseAnySimpleType( String lexicalXSDAnySimpleType );
+
+    /**
+     * Converts the string argument into a string.
+     * @param val
+     *     A string value.
+     * @return
+     *     A string containing a lexical representation of xsd:string
+     */
+    public String printString( String val );
+
+    /**
+     * Converts a BigInteger value into a string.
+     * @param val
+     *     A BigInteger value
+     * @return
+     *     A string containing a lexical representation of xsd:integer
+     * @throws IllegalArgumentException {@code val} is null.
+     */
+    public String printInteger( java.math.BigInteger val );
+
+    /**
+     * Converts an int value into a string.
+     * @param val
+     *     An int value
+     * @return
+     *     A string containing a lexical representation of xsd:int
+     */
+    public String printInt( int val );
+
+
+    /**
+     * Converts a long value into a string.
+     * @param val
+     *     A long value
+     * @return
+     *     A string containing a lexical representation of xsd:long
+     */
+    public String printLong( long val );
+
+    /**
+     * Converts a short value into a string.
+     * @param val
+     *     A short value
+     * @return
+     *     A string containing a lexical representation of xsd:short
+     */
+    public String printShort( short val );
+
+    /**
+     * Converts a BigDecimal value into a string.
+     * @param val
+     *     A BigDecimal value
+     * @return
+     *     A string containing a lexical representation of xsd:decimal
+     * @throws IllegalArgumentException {@code val} is null.
+     */
+    public String printDecimal( java.math.BigDecimal val );
+
+    /**
+     * Converts a float value into a string.
+     * @param val
+     *     A float value
+     * @return
+     *     A string containing a lexical representation of xsd:float
+     */
+    public String printFloat( float val );
+
+    /**
+     * Converts a double value into a string.
+     * @param val
+     *     A double value
+     * @return
+     *     A string containing a lexical representation of xsd:double
+     */
+    public String printDouble( double val );
+
+    /**
+     * Converts a boolean value into a string.
+     * @param val
+     *     A boolean value
+     * @return
+     *     A string containing a lexical representation of xsd:boolean
+     */
+    public String printBoolean( boolean val );
+
+    /**
+     * Converts a byte value into a string.
+     * @param val
+     *     A byte value
+     * @return
+     *     A string containing a lexical representation of xsd:byte
+     */
+    public String printByte( byte val );
+
+    /**
+     * Converts a QName instance into a string.
+     * @param val
+     *     A QName value
+     * @param nsc
+     *     A namespace context for interpreting a prefix within a QName.
+     * @return
+     *     A string containing a lexical representation of QName
+     * @throws IllegalArgumentException if {@code val} is null or
+     * if {@code nsc} is non-null or {@code nsc.getPrefix(nsprefixFromVal)} is null.
+     */
+    public String printQName( javax.xml.namespace.QName val,
+                              javax.xml.namespace.NamespaceContext nsc );
+
+    /**
+     * Converts a Calendar value into a string.
+     * @param val
+     *     A Calendar value
+     * @return
+     *     A string containing a lexical representation of xsd:dateTime
+     * @throws IllegalArgumentException if {@code val} is null.
+     */
+    public String printDateTime( java.util.Calendar val );
+
+    /**
+     * Converts an array of bytes into a string.
+     * @param val
+     *     an array of bytes
+     * @return
+     *     A string containing a lexical representation of xsd:base64Binary
+     * @throws IllegalArgumentException if {@code val} is null.
+     */
+    public String printBase64Binary( byte[] val );
+
+    /**
+     * Converts an array of bytes into a string.
+     * @param val
+     *     an array of bytes
+     * @return
+     *     A string containing a lexical representation of xsd:hexBinary
+     * @throws IllegalArgumentException if {@code val} is null.
+     */
+    public String printHexBinary( byte[] val );
+
+    /**
+     * Converts a long value into a string.
+     * @param val
+     *     A long value
+     * @return
+     *     A string containing a lexical representation of xsd:unsignedInt
+     */
+    public String printUnsignedInt( long val );
+
+    /**
+     * Converts an int value into a string.
+     * @param val
+     *     An int value
+     * @return
+     *     A string containing a lexical representation of xsd:unsignedShort
+     */
+    public String printUnsignedShort( int val );
+
+    /**
+     * Converts a Calendar value into a string.
+     * @param val
+     *     A Calendar value
+     * @return
+     *     A string containing a lexical representation of xsd:time
+     * @throws IllegalArgumentException if {@code val} is null.
+     */
+    public String printTime( java.util.Calendar val );
+
+    /**
+     * Converts a Calendar value into a string.
+     * @param val
+     *     A Calendar value
+     * @return
+     *     A string containing a lexical representation of xsd:date
+     * @throws IllegalArgumentException if {@code val} is null.
+     */
+    public String printDate( java.util.Calendar val );
+
+    /**
+     * Converts a string value into a string.
+     * @param val
+     *     A string value
+     * @return
+     *     A string containing a lexical representation of xsd:AnySimpleType
+     */
+    public String printAnySimpleType( String val );
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/Element.java b/jaxb-api/src/main/java/javax/xml/bind/Element.java
new file mode 100644
index 0000000..d281616
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/Element.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This is an element marker interface.
+ *
+ * Under certain circumstances, it is necessary for the binding compiler to 
+ * generate derived java content classes that implement this interface.  In 
+ * those cases, client applications must supply element instances rather than 
+ * types of elements.  For more detail, see section 5.7 "Element Declaration" 
+ * and 5.7.1 "Bind to Java Element Interface" of the specification.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @since 1.6, JAXB 1.0
+ */
+
+public interface Element {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/GetPropertyAction.java b/jaxb-api/src/main/java/javax/xml/bind/GetPropertyAction.java
new file mode 100644
index 0000000..623ebd5
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/GetPropertyAction.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.security.PrivilegedAction;
+
+/**
+ * {@link PrivilegedAction} that gets the system property value.
+ * @author Kohsuke Kawaguchi
+ */
+final class GetPropertyAction implements PrivilegedAction<String> {
+    private final String propertyName;
+
+    public GetPropertyAction(String propertyName) {
+        this.propertyName = propertyName;
+    }
+
+    public String run() {
+        return System.getProperty(propertyName);
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXB.java b/jaxb-api/src/main/java/javax/xml/bind/JAXB.java
new file mode 100644
index 0000000..0d9e6a6
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXB.java
@@ -0,0 +1,614 @@
+/*
+ * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import java.beans.Introspector;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+import java.lang.ref.WeakReference;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+
+/**
+ * Class that defines convenience methods for common, simple use of JAXB.
+ *
+ * <p>
+ * Methods defined in this class are convenience methods that combine several basic operations
+ * in the {@link JAXBContext}, {@link Unmarshaller}, and {@link Marshaller}.
+ *
+ * They are designed
+ * to be the prefered methods for developers new to JAXB. They have
+ * the following characterstics:
+ *
+ * <ol>
+ *  <li>Generally speaking, the performance is not necessarily optimal.
+ *      It is expected that people who need to write performance
+ *      critical code will use the rest of the JAXB API directly.
+ *  <li>Errors that happen during the processing is wrapped into
+ *      {@link DataBindingException} (which will have {@link JAXBException}
+ *      as its {@link Throwable#getCause() cause}. It is expected that
+ *      people who prefer the checked exception would use
+ *      the rest of the JAXB API directly.
+ * </ol>
+ *
+ * <p>
+ * In addition, the {@code unmarshal} methods have the following characteristic:
+ *
+ * <ol>
+ *  <li>Schema validation is not performed on the input XML.
+ *      The processing will try to continue even if there
+ *      are errors in the XML, as much as possible. Only as
+ *      the last resort, this method fails with {@link DataBindingException}.
+ * </ol>
+ *
+ * <p>
+ * Similarly, the {@code marshal} methods have the following characteristic:
+ * <ol>
+ *  <li>The processing will try to continue even if the Java object tree
+ *      does not meet the validity requirement. Only as
+ *      the last resort, this method fails with {@link DataBindingException}.
+ * </ol>
+ *
+ *
+ * <p>
+ * All the methods on this class require non-null arguments to all parameters.
+ * The {@code unmarshal} methods either fail with an exception or return
+ * a non-null value.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.1
+ */
+public final class JAXB {
+    /**
+     * No instanciation is allowed.
+     */
+    private JAXB() {}
+
+    /**
+     * To improve the performance, we'll cache the last {@link JAXBContext} used.
+     */
+    private static final class Cache {
+        final Class type;
+        final JAXBContext context;
+
+        public Cache(Class type) throws JAXBException {
+            this.type = type;
+            this.context = JAXBContext.newInstance(type);
+        }
+    }
+
+    /**
+     * Cache. We don't want to prevent the {@link Cache#type} from GC-ed,
+     * hence {@link WeakReference}.
+     */
+    private static volatile WeakReference<Cache> cache;
+
+    /**
+     * Obtains the {@link JAXBContext} from the given type,
+     * by using the cache if possible.
+     *
+     * <p>
+     * We don't use locks to control access to {@link #cache}, but this code
+     * should be thread-safe thanks to the immutable {@link Cache} and {@code volatile}.
+     */
+    private static <T> JAXBContext getContext(Class<T> type) throws JAXBException {
+        WeakReference<Cache> c = cache;
+        if(c!=null) {
+            Cache d = c.get();
+            if(d!=null && d.type==type)
+                return d.context;
+        }
+
+        // overwrite the cache
+        Cache d = new Cache(type);
+        cache = new WeakReference<Cache>(d);
+
+        return d.context;
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      Reads the entire file as XML.
+     */
+    public static <T> T unmarshal( File xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(new StreamSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The resource pointed by the URL is read in its entirety.
+     */
+    public static <T> T unmarshal( URL xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The URI is {@link URI#toURL() turned into URL} and then
+     *      follows the handling of {@code URL}.
+     */
+    public static <T> T unmarshal( URI xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The string is first interpreted as an absolute {@code URI}.
+     *      If it's not {@link URI#isAbsolute() a valid absolute URI},
+     *      then it's interpreted as a {@code File}
+     */
+    public static <T> T unmarshal( String xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The entire stream is read as an XML infoset.
+     *      Upon a successful completion, the stream will be closed by this method.
+     */
+    public static <T> T unmarshal( InputStream xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The character stream is read as an XML infoset.
+     *      The encoding declaration in the XML will be ignored.
+     *      Upon a successful completion, the stream will be closed by this method.
+     */
+    public static <T> T unmarshal( Reader xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    /**
+     * Reads in a Java object tree from the given XML input.
+     *
+     * @param xml
+     *      The XML infoset that the {@link Source} represents is read.
+     */
+    public static <T> T unmarshal( Source xml, Class<T> type ) {
+        try {
+            JAXBElement<T> item = getContext(type).createUnmarshaller().unmarshal(toSource(xml), type);
+            return item.getValue();
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+
+
+    /**
+     * Creates {@link Source} from various XML representation.
+     * See {@link #unmarshal} for the conversion rules.
+     */
+    private static Source toSource(Object xml) throws IOException {
+        if(xml==null)
+            throw new IllegalArgumentException("no XML is given");
+
+        if (xml instanceof String) {
+            try {
+                xml=new URI((String)xml);
+            } catch (URISyntaxException e) {
+                xml=new File((String)xml);
+            }
+        }
+        if (xml instanceof File) {
+            File file = (File) xml;
+            return new StreamSource(file);
+        }
+        if (xml instanceof URI) {
+            URI uri = (URI) xml;
+            xml=uri.toURL();
+        }
+        if (xml instanceof URL) {
+            URL url = (URL) xml;
+            return new StreamSource(url.toExternalForm());
+        }
+        if (xml instanceof InputStream) {
+            InputStream in = (InputStream) xml;
+            return new StreamSource(in);
+        }
+        if (xml instanceof Reader) {
+            Reader r = (Reader) xml;
+            return new StreamSource(r);
+        }
+        if (xml instanceof Source) {
+            return (Source) xml;
+        }
+        throw new IllegalArgumentException("I don't understand how to handle "+xml.getClass());
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      XML will be written to this file. If it already exists,
+     *      it will be overwritten.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, File xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be {@link URLConnection#getOutputStream() sent} to the
+     *      resource pointed by this URL. Note that not all {@code URL}s support
+     *      such operation, and exact semantics depends on the {@code URL}
+     *      implementations. In case of {@link HttpURLConnection HTTP URLs},
+     *      this will perform HTTP POST.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, URL xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The URI is {@link URI#toURL() turned into URL} and then
+     *      follows the handling of {@code URL}. See above.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, URI xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The string is first interpreted as an absolute {@code URI}.
+     *      If it's not {@link URI#isAbsolute() a valid absolute URI},
+     *      then it's interpreted as a {@code File}
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, String xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be sent to the given {@link OutputStream}.
+     *      Upon a successful completion, the stream will be closed by this method.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, OutputStream xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be sent as a character stream to the given {@link Writer}.
+     *      Upon a successful completion, the stream will be closed by this method.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, Writer xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      The XML will be sent to the {@link Result} object.
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    public static void marshal( Object jaxbObject, Result xml ) {
+        _marshal(jaxbObject,xml);
+    }
+
+    /**
+     * Writes a Java object tree to XML and store it to the specified location.
+     *
+     * <p>
+     * This method is a convenience method that combines several basic operations
+     * in the {@link JAXBContext} and {@link Marshaller}. This method is designed
+     * to be the prefered method for developers new to JAXB. This method
+     * has the following characterstics:
+     *
+     * <ol>
+     *  <li>Generally speaking, the performance is not necessarily optimal.
+     *      It is expected that those people who need to write performance
+     *      critical code will use the rest of the JAXB API directly.
+     *  <li>Errors that happen during the processing is wrapped into
+     *      {@link DataBindingException} (which will have {@link JAXBException}
+     *      as its {@link Throwable#getCause() cause}. It is expected that
+     *      those people who prefer the checked exception would use
+     *      the rest of the JAXB API directly.
+     * </ol>
+     *
+     * @param jaxbObject
+     *      The Java object to be marshalled into XML. If this object is
+     *      a {@link JAXBElement}, it will provide the root tag name and
+     *      the body. If this object has {@link XmlRootElement}
+     *      on its class definition, that will be used as the root tag name
+     *      and the given object will provide the body. Otherwise,
+     *      the root tag name is {@link Introspector#decapitalize(String) infered} from
+     *      {@link Class#getSimpleName() the short class name}.
+     *      This parameter must not be null.
+     *
+     * @param xml
+     *      Represents the receiver of XML. Objects of the following types are allowed.
+     *
+     *      <table><tr>
+     *          <th>Type</th>
+     *          <th>Operation</th>
+     *      </tr><tr>
+     *          <td>{@link File}</td>
+     *          <td>XML will be written to this file. If it already exists,
+     *              it will be overwritten.</td>
+     *      </tr><tr>
+     *          <td>{@link URL}</td>
+     *          <td>The XML will be {@link URLConnection#getOutputStream() sent} to the
+     *              resource pointed by this URL. Note that not all {@code URL}s support
+     *              such operation, and exact semantics depends on the {@code URL}
+     *              implementations. In case of {@link HttpURLConnection HTTP URLs},
+     *              this will perform HTTP POST.</td>
+     *      </tr><tr>
+     *          <td>{@link URI}</td>
+     *          <td>The URI is {@link URI#toURL() turned into URL} and then
+     *              follows the handling of {@code URL}. See above.</td>
+     *      </tr><tr>
+     *          <td>{@link String}</td>
+     *          <td>The string is first interpreted as an absolute {@code URI}.
+     *              If it's not {@link URI#isAbsolute() a valid absolute URI},
+     *              then it's interpreted as a {@code File}</td>
+     *      </tr><tr>
+     *          <td>{@link OutputStream}</td>
+     *          <td>The XML will be sent to the given {@link OutputStream}.
+     *              Upon a successful completion, the stream will be closed by this method.</td>
+     *      </tr><tr>
+     *          <td>{@link Writer}</td>
+     *          <td>The XML will be sent as a character stream to the given {@link Writer}.
+     *              Upon a successful completion, the stream will be closed by this method.</td>
+     *      </tr><tr>
+     *          <td>{@link Result}</td>
+     *          <td>The XML will be sent to the {@link Result} object.</td>
+     *      </tr></table>
+     *
+     * @throws DataBindingException
+     *      If the operation fails, such as due to I/O error, unbindable classes.
+     */
+    private static void _marshal( Object jaxbObject, Object xml ) {
+        try {
+            JAXBContext context;
+
+            if(jaxbObject instanceof JAXBElement) {
+                context = getContext(((JAXBElement<?>)jaxbObject).getDeclaredType());
+            } else {
+                Class<?> clazz = jaxbObject.getClass();
+                XmlRootElement r = clazz.getAnnotation(XmlRootElement.class);
+                context = getContext(clazz);
+                if(r==null) {
+                    // we need to infer the name
+                    jaxbObject = new JAXBElement(new QName(inferName(clazz)),clazz,jaxbObject);
+                }
+            }
+
+            Marshaller m = context.createMarshaller();
+            m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
+            m.marshal(jaxbObject, toResult(xml));
+        } catch (JAXBException e) {
+            throw new DataBindingException(e);
+        } catch (IOException e) {
+            throw new DataBindingException(e);
+        }
+    }
+
+    private static String inferName(Class clazz) {
+        return Introspector.decapitalize(clazz.getSimpleName());
+    }
+
+    /**
+     * Creates {@link Result} from various XML representation.
+     * See {@link #_marshal(Object,Object)} for the conversion rules.
+     */
+    private static Result toResult(Object xml) throws IOException {
+        if(xml==null)
+            throw new IllegalArgumentException("no XML is given");
+
+        if (xml instanceof String) {
+            try {
+                xml=new URI((String)xml);
+            } catch (URISyntaxException e) {
+                xml=new File((String)xml);
+            }
+        }
+        if (xml instanceof File) {
+            File file = (File) xml;
+            return new StreamResult(file);
+        }
+        if (xml instanceof URI) {
+            URI uri = (URI) xml;
+            xml=uri.toURL();
+        }
+        if (xml instanceof URL) {
+            URL url = (URL) xml;
+            URLConnection con = url.openConnection();
+            con.setDoOutput(true);
+            con.setDoInput(false);
+            con.connect();
+            return new StreamResult(con.getOutputStream());
+        }
+        if (xml instanceof OutputStream) {
+            OutputStream os = (OutputStream) xml;
+            return new StreamResult(os);
+        }
+        if (xml instanceof Writer) {
+            Writer w = (Writer)xml;
+            return new StreamResult(w);
+        }
+        if (xml instanceof Result) {
+            return (Result) xml;
+        }
+        throw new IllegalArgumentException("I don't understand how to handle "+xml.getClass());
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXBContext.java b/jaxb-api/src/main/java/javax/xml/bind/JAXBContext.java
new file mode 100644
index 0000000..8d75ce2
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXBContext.java
@@ -0,0 +1,819 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ * The {@code JAXBContext} class provides the client's entry point to the
+ * JAXB API. It provides an abstraction for managing the XML/Java binding
+ * information necessary to implement the JAXB binding framework operations:
+ * unmarshal, marshal and validate.
+ *
+ * <p>A client application normally obtains new instances of this class using
+ * one of these two styles for newInstance methods, although there are other
+ * specialized forms of the method available:
+ *
+ * <ul>
+ * <li>{@link #newInstance(String, ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br>
+ * The JAXBContext instance is initialized from a list of colon
+ * separated Java package names. Each java package contains
+ * JAXB mapped classes, schema-derived classes and/or user annotated
+ * classes. Additionally, the java package may contain JAXB package annotations
+ * that must be processed. (see JLS, Section 7.4.1 "Named Packages").
+ * </li>
+ * <li>{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )} <br>
+ * The JAXBContext instance is initialized with class(es)
+ * passed as parameter(s) and classes that are statically reachable from
+ * these class(es). See {@link #newInstance(Class...)} for details.
+ * </li>
+ * </ul>
+ *
+ * <p><i>
+ * The following JAXB 1.0 requirement is only required for schema to
+ * java interface/implementation binding. It does not apply to JAXB annotated
+ * classes. JAXB Providers must generate a {@code jaxb.properties} file in
+ * each package containing schema derived classes.  The property file must
+ * contain a property named {@code javax.xml.bind.context.factory} whose
+ * value is the name of the class that implements the {@code createContext}
+ * APIs.</i>
+ *
+ * <p><i>
+ * The class supplied by the provider does not have to be assignable to
+ * {@code javax.xml.bind.JAXBContext}, it simply has to provide a class that
+ * implements the {@code createContext} APIs.</i>
+ *
+ * <p><i>
+ * In addition, the provider must call the
+ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
+ * DatatypeConverter.setDatatypeConverter} api prior to any client
+ * invocations of the marshal and unmarshal methods.  This is necessary to
+ * configure the datatype converter that will be used during these operations.</i>
+ *
+ * <a name="Unmarshalling"></a>
+ * <h3>Unmarshalling</h3>
+ * <p>
+ * The {@link Unmarshaller} class provides the client application the ability
+ * to convert XML data into a tree of Java content objects.
+ * The unmarshal method allows for
+ * any global XML element declared in the schema to be unmarshalled as
+ * the root of an instance document.
+ * Additionally, the unmarshal method allows for an unrecognized root element that
+ * has  an xsi:type attribute's value that references a type definition declared in
+ * the schema  to be unmarshalled as the root of an instance document.
+ * The {@code JAXBContext} object
+ * allows the merging of global elements and type definitions across a set of schemas (listed
+ * in the {@code contextPath}). Since each schema in the schema set can belong
+ * to distinct namespaces, the unification of schemas to an unmarshalling
+ * context must be namespace independent.  This means that a client
+ * application is able to unmarshal XML documents that are instances of
+ * any of the schemas listed in the {@code contextPath}.  For example:
+ *
+ * <pre>
+ *      JAXBContext jc = JAXBContext.newInstance( "com.acme.foo:com.acme.bar" );
+ *      Unmarshaller u = jc.createUnmarshaller();
+ *      FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) ); // ok
+ *      BarObject barObj = (BarObject)u.unmarshal( new File( "bar.xml" ) ); // ok
+ *      BazObject bazObj = (BazObject)u.unmarshal( new File( "baz.xml" ) ); // error, "com.acme.baz" not in contextPath
+ * </pre>
+ *
+ * <p>
+ * The client application may also generate Java content trees explicitly rather
+ * than unmarshalling existing XML data.  For all JAXB-annotated value classes,
+ * an application can create content using constructors.
+ * For schema-derived interface/implementation classes and for the
+ * creation of elements that are not bound to a JAXB-annotated
+ * class, an application needs to have access and knowledge about each of
+ * the schema derived {@code ObjectFactory} classes that exist in each of
+ * java packages contained in the {@code contextPath}.  For each schema
+ * derived java class, there is a static factory method that produces objects
+ * of that type.  For example,
+ * assume that after compiling a schema, you have a package {@code com.acme.foo}
+ * that contains a schema derived interface named {@code PurchaseOrder}.  In
+ * order to create objects of that type, the client application would use the
+ * factory method like this:
+ *
+ * <pre>
+ *       com.acme.foo.PurchaseOrder po =
+ *           com.acme.foo.ObjectFactory.createPurchaseOrder();
+ * </pre>
+ *
+ * <p>
+ * Once the client application has an instance of the the schema derived object,
+ * it can use the mutator methods to set content on it.
+ *
+ * <p>
+ * For more information on the generated {@code ObjectFactory} classes, see
+ * Section 4.2 <i>Java Package</i> of the specification.
+ *
+ * <p>
+ * <i>The provider must generate a class in each
+ * package that contains all of the necessary object factory methods for that
+ * package named ObjectFactory as well as the static
+ * {@code newInstance( javaContentInterface )} method</i>
+ *
+ * <h3>Marshalling</h3>
+ * <p>
+ * The {@link Marshaller} class provides the client application the ability
+ * to convert a Java content tree back into XML data.  There is no difference
+ * between marshalling a content tree that is created manually using the factory
+ * methods and marshalling a content tree that is the result an {@code unmarshal}
+ * operation.  Clients can marshal a java content tree back to XML data
+ * to a {@code java.io.OutputStream} or a {@code java.io.Writer}.  The
+ * marshalling process can alternatively produce SAX2 event streams to a
+ * registered {@code ContentHandler} or produce a DOM Node object.
+ * Client applications have control over the output encoding as well as
+ * whether or not to marshal the XML data as a complete document or
+ * as a fragment.
+ *
+ * <p>
+ * Here is a simple example that unmarshals an XML document and then marshals
+ * it back out:
+ *
+ * <pre>
+ *        JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *
+ *        // unmarshal from foo.xml
+ *        Unmarshaller u = jc.createUnmarshaller();
+ *        FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) );
+ *
+ *        // marshal to System.out
+ *        Marshaller m = jc.createMarshaller();
+ *        m.marshal( fooObj, System.out );
+ * </pre>
+ *
+ *
+ * <h3>Validation</h3>
+ * <p>
+ * Validation has been changed significantly since JAXB 1.0.  The {@link Validator}
+ * class has been deprecated and made optional.  This means that you are advised
+ * not to use this class and, in fact, it may not even be available depending on
+ * your JAXB provider.  JAXB 1.0 client applications that rely on {@code Validator}
+ * will still work properly when deployed with the JAXB 1.0 runtime system.
+ *
+ * In JAXB 2.0, the {@link Unmarshaller} has included convenince methods that expose
+ * the JAXP 1.3 {@link javax.xml.validation} framework.  Please refer to the
+ * {@link Unmarshaller#setSchema(javax.xml.validation.Schema)} API for more
+ * information.
+ *
+ *
+ * <h3>JAXB Runtime Binding Framework Compatibility</h3>
+ * <p>
+ * The following JAXB 1.0 restriction only applies to binding schema to
+ * interfaces/implementation classes.
+ * Since this binding does not require a common runtime system, a JAXB
+ * client application must not attempt to mix runtime objects ({@code JAXBContext,
+ * Marshaller}, etc. ) from different providers.  This does not
+ * mean that the client application isn't portable, it simply means that a
+ * client has to use a runtime system provided by the same provider that was
+ * used to compile the schema.
+ *
+ *
+ * <h3>Discovery of JAXB implementation</h3>
+ * <p>
+ * To create an instance of {@link JAXBContext}, one of {@code JAXBContext.newInstance(...)} methods is invoked. After
+ * JAX-B implementation is discovered, call is delegated to appropriate provider's method {@code createContext(...)}
+ * passing parameters from the original call.
+ * <p>
+ * JAX-B implementation discovery happens each time {@code JAXBContext.newInstance} is invoked. If there is no user
+ * specific configuration provided, default JAX-B provider must be returned.
+ * <p>
+ * Implementation discovery consists of following steps:
+ *
+ * <ol>
+ *
+ * <li>
+ * Packages/classes explicitly passed in to the {@link #newInstance} method are processed in the order they are
+ * specified, until {@code jaxb.properties} file is looked up in its package, by using the associated classloader &mdash;
+ * this is {@link Class#getClassLoader() the owner class loader} for a {@link Class} argument, and for a package
+ * the specified {@link ClassLoader}.
+ *
+ * <p>
+ * If such a resource is discovered, it is {@link Properties#load(InputStream) loaded} as a property file, and
+ * the value of the {@link #JAXB_CONTEXT_FACTORY} key will be assumed to be the provider factory class. If no value
+ * found, {@code "javax.xml.bind.context.factory"} is used as a key for backwards compatibility reasons. This class is
+ * then loaded by the associated class loader discussed above.
+ *
+ * <p>
+ * This phase of the look up allows some packages to force the use of a certain JAXB implementation.
+ * (For example, perhaps the schema compiler has generated some vendor extension in the code.)
+ *
+ * <p>
+ * This configuration method is deprecated.
+ *
+ * <li>
+ * If the system property {@link #JAXB_CONTEXT_FACTORY} exists, then its value is assumed to be the provider
+ * factory class. If no such property exists, properties {@code "javax.xml.bind.context.factory"} and
+ * {@code "javax.xml.bind.JAXBContext"} are checked too (in this order), for backwards compatibility reasons. This phase
+ * of the look up enables per-JVM override of the JAXB implementation.
+ *
+ * <li>
+ * Provider of {@link javax.xml.bind.JAXBContextFactory} is loaded using the service-provider loading
+ * facilities, defined by the {@link java.util.ServiceLoader} class, to attempt
+ * to locate and load an implementation of the service using the {@linkplain
+ * java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}: the service-provider loading facility
+ * will use the {@linkplain java.lang.Thread#getContextClassLoader() current thread's context class loader}
+ * to attempt to load the context factory. If the context class loader is null, the
+ * {@linkplain ClassLoader#getSystemClassLoader() system class loader} will be used.
+ * <br>
+ * In case of {@link java.util.ServiceConfigurationError service
+ * configuration error} a {@link javax.xml.bind.JAXBException} will be thrown.
+ *
+ * <li>
+ * Look for resource {@code /META-INF/services/javax.xml.bind.JAXBContext} using provided class loader.
+ * Methods without class loader parameter use {@code Thread.currentThread().getContextClassLoader()}.
+ * If such a resource exists, its content is assumed to be the provider factory class.
+ *
+ * This configuration method is deprecated.
+ *
+ * <li>
+ * Finally, if all the steps above fail, then the rest of the look up is unspecified. That said,
+ * the recommended behavior is to simply look for some hard-coded platform default JAXB implementation.
+ * This phase of the look up is so that Java SE can have its own JAXB implementation as the last resort.
+ * </ol>
+ *
+ * <p>
+ * Once the provider factory class is discovered, context creation is delegated to one of its
+ * {@code createContext(...)} methods.
+ *
+ * For backward compatibility reasons, there are two ways how to implement provider factory class:
+ * <ol>
+ *     <li>the class is implementation of {@link javax.xml.bind.JAXBContextFactory}. It must also implement no-arg
+ *     constructor. If discovered in other step then 3, new instance using no-arg constructor is created first.
+ *     After that, appropriate instance method is invoked on this instance.
+ *     <li>the class is not implementation of interface above and then it is mandated to implement the following
+ *     static method signatures:
+ * <pre>
+ *
+ * public static JAXBContext createContext(
+ *                                      String contextPath,
+ *                                      ClassLoader classLoader,
+ *                                      Map&lt;String,Object&gt; properties ) throws JAXBException
+ *
+ * public static JAXBContext createContext(
+ *                                      Class[] classes,
+ *                                      Map&lt;String,Object&gt; properties ) throws JAXBException
+ * </pre>
+ *      In this scenario, appropriate static method is used instead of instance method. This approach is incompatible
+ *      with {@link java.util.ServiceLoader} so it can't be used with step 3.
+ * </ol>
+ * <p>
+ * There is no difference in behavior of given method {@code createContext(...)} regardless of whether it uses approach
+ * 1 (JAXBContextFactory) or 2 (no interface, static methods).
+ *
+ * @apiNote
+ * Service discovery method using resource {@code /META-INF/services/javax.xml.bind.JAXBContext} (described in step 4)
+ * is supported only to allow backwards compatibility, it is strongly recommended to migrate to standard
+ * {@link java.util.ServiceLoader} mechanism (described in step 3). The difference here is the resource name, which
+ * doesn't match service's type name.
+ * <p>
+ * Also using providers implementing interface {@link JAXBContextFactory} is preferred over using ones defining
+ * static methods, same as {@link JAXBContext#JAXB_CONTEXT_FACTORY} property is preferred over property
+ * {@code "javax.xml.bind.context.factory"}
+ *
+ * @implNote
+ * Within the last step, if Glassfish AS environment detected, its specific service loader is used to find factory class.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li>
+ *             <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ *             <li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ *
+ * @see Marshaller
+ * @see Unmarshaller
+ * @see <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.4.1">S 7.4.1 "Named Packages"
+ *      in Java Language Specification</a>
+ *
+ * @since 1.6, JAXB 1.0
+ */
+public abstract class JAXBContext {
+
+    /**
+     * The name of the property that contains the name of the class capable
+     * of creating new {@code JAXBContext} objects.
+     */
+    public static final String JAXB_CONTEXT_FACTORY = "javax.xml.bind.JAXBContextFactory";
+
+    protected JAXBContext() {
+    }
+
+
+    /**
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * This is a convenience method to invoke the
+     * {@link #newInstance(String,ClassLoader)} method with
+     * the context class loader of the current thread.
+     *
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code JAXBContext} such as
+     * <ol>
+     *   <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+     *   <li>an ambiguity among global elements contained in the contextPath</li>
+     *   <li>failure to locate a value for the context factory provider property</li>
+     *   <li>mixing schema derived packages from different providers on the same contextPath</li>
+     *   <li>packages are not open to {@code java.xml.bind} module</li>
+     * </ol>
+     */
+    public static JAXBContext newInstance( String contextPath )
+            throws JAXBException {
+
+        //return newInstance( contextPath, JAXBContext.class.getClassLoader() );
+        return newInstance( contextPath, getContextClassLoader());
+    }
+
+    /**
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * The client application must supply a context path which is a list of
+     * colon (':', \u005Cu003A) separated java package names that contain
+     * schema-derived classes and/or fully qualified JAXB-annotated classes.
+     * Schema-derived
+     * code is registered with the JAXBContext by the
+     * ObjectFactory.class generated per package.
+     * Alternatively than being listed in the context path, programmer
+     * annotated JAXB mapped classes can be listed in a
+     * {@code jaxb.index} resource file, format described below.
+     * Note that a java package can contain both schema-derived classes and
+     * user annotated JAXB classes. Additionally, the java package may
+     * contain JAXB package annotations  that must be processed. (see JLS,
+     * Section 7.4.1 "Named Packages").
+     * </p>
+     *
+     * <p>
+     * Every package listed on the contextPath must meet <b>one or both</b> of the
+     * following conditions otherwise a {@code JAXBException} will be thrown:
+     * </p>
+     * <ol>
+     *   <li>it must contain ObjectFactory.class</li>
+     *   <li>it must contain jaxb.index</li>
+     * </ol>
+     *
+     * <p>
+     * <b>Format for jaxb.index</b>
+     * <p>
+     * The file contains a newline-separated list of class names.
+     * Space and tab characters, as well as blank
+     * lines, are ignored. The comment character
+     * is '#' (0x23); on each line all characters following the first comment
+     * character are ignored. The file must be encoded in UTF-8. Classes that
+     * are reachable, as defined in {@link #newInstance(Class...)}, from the
+     * listed classes are also registered with JAXBContext.
+     * <p>
+     * Constraints on class name occuring in a {@code jaxb.index} file are:
+     * <ul>
+     *   <li>Must not end with ".class".</li>
+     *   <li>Class names are resolved relative to package containing
+     *       {@code jaxb.index} file. Only classes occuring directly in package
+     *       containing {@code jaxb.index} file are allowed.</li>
+     *   <li>Fully qualified class names are not allowed.
+     *       A qualified class name,relative to current package,
+     *       is only allowed to specify a nested or inner class.</li>
+     * </ul>
+     *
+     * <p>
+     * To maintain compatibility with JAXB 1.0 schema to java
+     * interface/implementation binding, enabled by schema customization
+     * {@code <jaxb:globalBindings valueClass="false">},
+     * the JAXB provider will ensure that each package on the context path
+     * has a {@code jaxb.properties} file which contains a value for the
+     * {@code javax.xml.bind.context.factory} property and that all values
+     * resolve to the same provider.  This requirement does not apply to
+     * JAXB annotated classes.
+     *
+     * <p>
+     * If there are any global XML element name collisions across the various
+     * packages listed on the {@code contextPath}, a {@code JAXBException}
+     * will be thrown.
+     *
+     * <p>
+     * Mixing generated interface/impl bindings from multiple JAXB Providers
+     * in the same context path may result in a {@code JAXBException}
+     * being thrown.
+     *
+     * <p>
+     * The steps involved in discovering the JAXB implementation is discussed in the class javadoc.
+     *
+     * @param contextPath
+     *      List of java package names that contain schema
+     *      derived class and/or java to schema (JAXB-annotated)
+     *      mapped classes.
+     *      Packages in {@code contextPath} that are in named modules must be
+     *      {@linkplain java.lang.Module#isOpen open} to at least the {@code java.xml.bind} module.
+     * @param classLoader
+     *      This class loader will be used to locate the implementation
+     *      classes.
+     *
+     * @return a new instance of a {@code JAXBContext}
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code JAXBContext} such as
+     * <ol>
+     *   <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+     *   <li>an ambiguity among global elements contained in the contextPath</li>
+     *   <li>failure to locate a value for the context factory provider property</li>
+     *   <li>mixing schema derived packages from different providers on the same contextPath</li>
+     *   <li>packages are not open to {@code java.xml.bind} module</li>
+     * </ol>
+     */
+    public static JAXBContext newInstance( String contextPath, ClassLoader classLoader ) throws JAXBException {
+
+        return newInstance(contextPath,classLoader,Collections.<String,Object>emptyMap());
+    }
+
+    /**
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * This is mostly the same as {@link JAXBContext#newInstance(String, ClassLoader)},
+     * but this version allows you to pass in provider-specific properties to configure
+     * the instantiation of {@link JAXBContext}.
+     *
+     * <p>
+     * The interpretation of properties is up to implementations. Implementations must
+     * throw {@code JAXBException} if it finds properties that it doesn't understand.
+     *
+     * @param contextPath
+     *      List of java package names that contain schema
+     *      derived class and/or java to schema (JAXB-annotated)
+     *      mapped classes.
+     *      Packages in {@code contextPath} that are in named modules must be
+     *      {@linkplain java.lang.Module#isOpen open} to at least the {@code java.xml.bind} module.
+     * @param classLoader
+     *      This class loader will be used to locate the implementation classes.
+     * @param properties
+     *      provider-specific properties. Can be null, which means the same thing as passing
+     *      in an empty map.
+     *
+     * @return a new instance of a {@code JAXBContext}
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code JAXBContext} such as
+     * <ol>
+     *   <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+     *   <li>an ambiguity among global elements contained in the contextPath</li>
+     *   <li>failure to locate a value for the context factory provider property</li>
+     *   <li>mixing schema derived packages from different providers on the same contextPath</li>
+     *   <li>packages are not open to {@code java.xml.bind} module</li>
+     * </ol>
+     * @since 1.6, JAXB 2.0
+     */
+    public static JAXBContext newInstance( String contextPath,
+                                           ClassLoader classLoader,
+                                           Map<String,?>  properties  ) throws JAXBException {
+
+        return ContextFinder.find(
+                        /* The default property name according to the JAXB spec */
+                JAXB_CONTEXT_FACTORY,
+
+                        /* the context path supplied by the client app */
+                contextPath,
+
+                        /* class loader to be used */
+                classLoader,
+                properties );
+    }
+
+// TODO: resurrect this once we introduce external annotations
+//    /**
+//     * Create a new instance of a {@code JAXBContext} class.
+//     *
+//     * <p>
+//     * The client application must supply a list of classes that the new
+//     * context object needs to recognize.
+//     *
+//     * Not only the new context will recognize all the classes specified,
+//     * but it will also recognize any classes that are directly/indirectly
+//     * referenced statically from the specified classes.
+//     *
+//     * For example, in the following Java code, if you do
+//     * {@code newInstance(Foo.class)}, the newly created {@link JAXBContext}
+//     * will recognize both {@code Foo} and {@code Bar}, but not {@code Zot}:
+//     * <pre>
+//     * class Foo {
+//     *      Bar b;
+//     * }
+//     * class Bar { int x; }
+//     * class Zot extends Bar { int y; }
+//     * </pre>
+//     *
+//     * Therefore, a typical client application only needs to specify the
+//     * top-level classes, but it needs to be careful.
+//     *
+//     * TODO: if we are to define other mechanisms, refer to them.
+//     *
+//     * @param externalBindings
+//     *      list of external binding files. Can be null or empty if none is used.
+//     *      when specified, those files determine how the classes are bound.
+//     *
+//     * @param classesToBeBound
+//     *      list of java classes to be recognized by the new {@link JAXBContext}.
+//     *      Can be empty, in which case a {@link JAXBContext} that only knows about
+//     *      spec-defined classes will be returned.
+//     *
+//     * @return
+//     *      A new instance of a {@code JAXBContext}.
+//     *
+//     * @throws JAXBException
+//     *      if an error was encountered while creating the
+//     *      {@code JAXBContext}, such as (but not limited to):
+//     * <ol>
+//     *  <li>No JAXB implementation was discovered
+//     *  <li>Classes use JAXB annotations incorrectly
+//     *  <li>Classes have colliding annotations (i.e., two classes with the same type name)
+//     *  <li>Specified external bindings are incorrect
+//     *  <li>The JAXB implementation was unable to locate
+//     *      provider-specific out-of-band information (such as additional
+//     *      files generated at the development time.)
+//     * </ol>
+//     *
+//     * @throws IllegalArgumentException
+//     *      if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+//     *
+//     * @since JAXB 2.0
+//     */
+//    public static JAXBContext newInstance( Source[] externalBindings, Class... classesToBeBound )
+//        throws JAXBException {
+//
+//        // empty class list is not an error, because the context will still include
+//        // spec-specified classes like String and Integer.
+//        // if(classesToBeBound.length==0)
+//        //    throw new IllegalArgumentException();
+//
+//        // but it is an error to have nulls in it.
+//        for( int i=classesToBeBound.length-1; i>=0; i-- )
+//            if(classesToBeBound[i]==null)
+//                throw new IllegalArgumentException();
+//
+//        return ContextFinder.find(externalBindings,classesToBeBound);
+//    }
+
+    /**
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * The client application must supply a list of classes that the new
+     * context object needs to recognize.
+     *
+     * Not only the new context will recognize all the classes specified,
+     * but it will also recognize any classes that are directly/indirectly
+     * referenced statically from the specified classes. Subclasses of
+     * referenced classes nor {@code @XmlTransient} referenced classes
+     * are not registered with JAXBContext.
+     *
+     * For example, in the following Java code, if you do
+     * {@code newInstance(Foo.class)}, the newly created {@link JAXBContext}
+     * will recognize both {@code Foo} and {@code Bar}, but not {@code Zot} or {@code FooBar}:
+     * <pre>
+     * class Foo {
+     *      &#64;XmlTransient FooBar c;
+     *      Bar b;
+     * }
+     * class Bar { int x; }
+     * class Zot extends Bar { int y; }
+     * class FooBar { }
+     * </pre>
+     *
+     * Therefore, a typical client application only needs to specify the
+     * top-level classes, but it needs to be careful.
+     *
+     * <p>
+     * Note that for each java package registered with JAXBContext,
+     * when the optional package annotations exist, they must be processed.
+     * (see JLS, Section 7.4.1 "Named Packages").
+     *
+     * <p>
+     * The steps involved in discovering the JAXB implementation is discussed in the class javadoc.
+     *
+     * @param classesToBeBound
+     *      List of java classes to be recognized by the new {@link JAXBContext}.
+     *      Classes in {@code classesToBeBound} that are in named modules must be in a package
+     *      that is {@linkplain java.lang.Module#isOpen open} to at least the {@code java.xml.bind} module.
+     *      Can be empty, in which case a {@link JAXBContext} that only knows about
+     *      spec-defined classes will be returned.
+     *
+     * @return
+     *      A new instance of a {@code JAXBContext}.
+     *
+     * @throws JAXBException
+     *      if an error was encountered while creating the
+     *      {@code JAXBContext}, such as (but not limited to):
+     * <ol>
+     *  <li>No JAXB implementation was discovered
+     *  <li>Classes use JAXB annotations incorrectly
+     *  <li>Classes have colliding annotations (i.e., two classes with the same type name)
+     *  <li>The JAXB implementation was unable to locate
+     *      provider-specific out-of-band information (such as additional
+     *      files generated at the development time.)
+     *  <li>{@code classesToBeBound} are not open to {@code java.xml.bind} module
+     * </ol>
+     *
+     * @throws IllegalArgumentException
+     *      if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public static JAXBContext newInstance( Class<?> ... classesToBeBound )
+            throws JAXBException {
+
+        return newInstance(classesToBeBound,Collections.<String,Object>emptyMap());
+    }
+
+    /**
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * An overloading of {@link JAXBContext#newInstance(Class...)}
+     * to configure 'properties' for this instantiation of {@link JAXBContext}.
+     *
+     * <p>
+     * The interpretation of properties is up to implementations. Implementations must
+     * throw {@code JAXBException} if it finds properties that it doesn't understand.
+     *
+     * @param classesToBeBound
+     *      List of java classes to be recognized by the new {@link JAXBContext}.
+     *      Classes in {@code classesToBeBound} that are in named modules must be in a package
+     *      that is {@linkplain java.lang.Module#isOpen open} to at least the {@code java.xml.bind} module.
+     *      Can be empty, in which case a {@link JAXBContext} that only knows about
+     *      spec-defined classes will be returned.
+     * @param properties
+     *      provider-specific properties. Can be null, which means the same thing as passing
+     *      in an empty map.
+     *
+     * @return
+     *      A new instance of a {@code JAXBContext}.
+     *
+     * @throws JAXBException
+     *      if an error was encountered while creating the
+     *      {@code JAXBContext}, such as (but not limited to):
+     * <ol>
+     *  <li>No JAXB implementation was discovered
+     *  <li>Classes use JAXB annotations incorrectly
+     *  <li>Classes have colliding annotations (i.e., two classes with the same type name)
+     *  <li>The JAXB implementation was unable to locate
+     *      provider-specific out-of-band information (such as additional
+     *      files generated at the development time.)
+     *  <li>{@code classesToBeBound} are not open to {@code java.xml.bind} module
+     * </ol>
+     *
+     * @throws IllegalArgumentException
+     *      if the parameter contains {@code null} (i.e., {@code newInstance(null,someMap);})
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public static JAXBContext newInstance( Class<?>[] classesToBeBound, Map<String,?> properties )
+            throws JAXBException {
+
+        if (classesToBeBound == null) {
+            throw new IllegalArgumentException();
+        }
+
+        // but it is an error to have nulls in it.
+        for (int i = classesToBeBound.length - 1; i >= 0; i--) {
+            if (classesToBeBound[i] == null) {
+                throw new IllegalArgumentException();
+            }
+        }
+
+        return ContextFinder.find(classesToBeBound,properties);
+    }
+
+    /**
+     * Create an {@code Unmarshaller} object that can be used to convert XML
+     * data into a java content tree.
+     *
+     * @return an {@code Unmarshaller} object
+     *
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code Unmarshaller} object
+     */
+    public abstract Unmarshaller createUnmarshaller() throws JAXBException;
+
+
+    /**
+     * Create a {@code Marshaller} object that can be used to convert a
+     * java content tree into XML data.
+     *
+     * @return a {@code Marshaller} object
+     *
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code Marshaller} object
+     */
+    public abstract Marshaller createMarshaller() throws JAXBException;
+
+
+    /**
+     * {@link Validator} has been made optional and deprecated in JAXB 2.0.  Please
+     * refer to the javadoc for {@link Validator} for more detail.
+     * <p>
+     * Create a {@code Validator} object that can be used to validate a
+     * java content tree against its source schema.
+     *
+     * @return a {@code Validator} object
+     *
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code Validator} object
+     * @deprecated since JAXB2.0
+     */
+    @Deprecated
+    public abstract Validator createValidator() throws JAXBException;
+
+    /**
+     * Creates a {@code Binder} object that can be used for
+     * associative/in-place unmarshalling/marshalling.
+     *
+     * @param domType select the DOM API to use by passing in its DOM Node class.
+     *
+     * @return always a new valid {@code Binder} object.
+     *
+     * @throws UnsupportedOperationException
+     *      if DOM API corresponding to {@code domType} is not supported by
+     *      the implementation.
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public <T> Binder<T> createBinder(Class<T> domType) {
+        // to make JAXB 1.0 implementations work, this method must not be
+        // abstract
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Creates a {@code Binder} for W3C DOM.
+     *
+     * @return always a new valid {@code Binder} object.
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public Binder<Node> createBinder() {
+        return createBinder(Node.class);
+    }
+
+    /**
+     * Creates a {@code JAXBIntrospector} object that can be used to
+     * introspect JAXB objects.
+     *
+     * @return
+     *      always return a non-null valid {@code JAXBIntrospector} object.
+     *
+     * @throws UnsupportedOperationException
+     *      Calling this method on JAXB 1.0 implementations will throw
+     *      an UnsupportedOperationException.
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public JAXBIntrospector createJAXBIntrospector() {
+        // to make JAXB 1.0 implementations work, this method must not be
+        // abstract
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * Generates the schema documents for this context.
+     *
+     * @param outputResolver
+     *      this object controls the output to which schemas
+     *      will be sent.
+     *
+     * @throws IOException
+     *      if {@link SchemaOutputResolver} throws an {@link IOException}.
+     *
+     * @throws UnsupportedOperationException
+     *      Calling this method on JAXB 1.0 implementations will throw
+     *      an UnsupportedOperationException.
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public void generateSchema(SchemaOutputResolver outputResolver) throws IOException  {
+        // to make JAXB 1.0 implementations work, this method must not be
+        // abstract
+        throw new UnsupportedOperationException();
+    }
+
+    private static ClassLoader getContextClassLoader() {
+        if (System.getSecurityManager() == null) {
+            return Thread.currentThread().getContextClassLoader();
+        } else {
+            return java.security.AccessController.doPrivileged(
+                    new java.security.PrivilegedAction<ClassLoader>() {
+                        public ClassLoader run() {
+                            return Thread.currentThread().getContextClassLoader();
+                        }
+                    });
+        }
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXBContextFactory.java b/jaxb-api/src/main/java/javax/xml/bind/JAXBContextFactory.java
new file mode 100644
index 0000000..9fc2090
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXBContextFactory.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.util.Map;
+
+/**
+ * <p>Factory that creates new <code>JAXBContext</code> instances.
+ *
+ * JAXBContextFactory can be located using {@link java.util.ServiceLoader#load(Class)}
+ *
+ * @since 9, JAXB 2.3
+ */
+public interface JAXBContextFactory {
+
+    /**
+     * <p>
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * For semantics see {@link javax.xml.bind.JAXBContext#newInstance(Class[], java.util.Map)}
+     *
+     * @param classesToBeBound
+     *      List of java classes to be recognized by the new {@link JAXBContext}.
+     *      Classes in {@code classesToBeBound} that are in named modules must be in a package
+     *      that is {@linkplain java.lang.Module#isOpen open} to at least the {@code java.xml.bind} module.
+     *      Can be empty, in which case a {@link JAXBContext} that only knows about
+     *      spec-defined classes will be returned.
+     * @param properties
+     *      provider-specific properties. Can be null, which means the same thing as passing
+     *      in an empty map.
+     *
+     * @return
+     *      A new instance of a {@code JAXBContext}.
+     *
+     * @throws JAXBException
+     *      if an error was encountered while creating the
+     *      {@code JAXBContext}, such as (but not limited to):
+     * <ol>
+     *  <li>No JAXB implementation was discovered
+     *  <li>Classes use JAXB annotations incorrectly
+     *  <li>Classes have colliding annotations (i.e., two classes with the same type name)
+     *  <li>The JAXB implementation was unable to locate
+     *      provider-specific out-of-band information (such as additional
+     *      files generated at the development time.)
+     *  <li>{@code classesToBeBound} are not open to {@code java.xml.bind} module
+     * </ol>
+     *
+     * @throws IllegalArgumentException
+     *      if the parameter contains {@code null} (i.e., {@code newInstance(null,someMap);})
+     *
+     * @since 9, JAXB 2.3
+     */
+    JAXBContext createContext(Class<?>[] classesToBeBound,
+                              Map<String, ?> properties ) throws JAXBException;
+
+    /**
+     * <p>
+     * Create a new instance of a {@code JAXBContext} class.
+     *
+     * <p>
+     * For semantics see {@link javax.xml.bind.JAXBContext#newInstance(String, ClassLoader, java.util.Map)}
+     *
+     * <p>
+     * The interpretation of properties is up to implementations. Implementations must
+     * throw {@code JAXBException} if it finds properties that it doesn't understand.
+     *
+     * @param contextPath
+     *      List of java package names that contain schema derived classes.
+     *      Classes in {@code classesToBeBound} that are in named modules must be in a package
+     *      that is {@linkplain java.lang.Module#isOpen open} to at least the {@code java.xml.bind} module.
+     * @param classLoader
+     *      This class loader will be used to locate the implementation classes.
+     * @param properties
+     *      provider-specific properties. Can be null, which means the same thing as passing
+     *      in an empty map.
+     *
+     * @return a new instance of a {@code JAXBContext}
+     * @throws JAXBException if an error was encountered while creating the
+     *                       {@code JAXBContext} such as
+     * <ol>
+     *   <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+     *   <li>an ambiguity among global elements contained in the contextPath</li>
+     *   <li>failure to locate a value for the context factory provider property</li>
+     *   <li>mixing schema derived packages from different providers on the same contextPath</li>
+     *   <li>packages are not open to {@code java.xml.bind} module</li>
+     * </ol>
+     *
+     * @since 9, JAXB 2.3
+     */
+    JAXBContext createContext(String contextPath,
+                              ClassLoader classLoader,
+                              Map<String, ?> properties ) throws JAXBException;
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXBElement.java b/jaxb-api/src/main/java/javax/xml/bind/JAXBElement.java
new file mode 100644
index 0000000..059e30f
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXBElement.java
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * <p>JAXB representation of an Xml Element.</p>
+ *
+ * <p>This class represents information about an Xml Element from both the element 
+ * declaration within a schema and the element instance value within an xml document
+ * with the following properties
+ * <ul>
+ *   <li>element's xml tag <b>{@code name}</b></li>
+ *   <li><b>{@code value}</b> represents the element instance's atttribute(s) and content model</li>
+ *   <li>element declaration's <b>{@code declaredType}</b> ({@code xs:element @type} attribute)</li>
+ *   <li><b>{@code scope}</b> of element declaration</li>
+ *   <li>boolean <b>{@code nil}</b> property. (element instance's <b>{@code xsi:nil}</b> attribute)</li>
+ * </ul>
+ * 
+ * <p>The {@code declaredType} and {@code scope} property are the
+ * JAXB class binding for the xml type definition.
+ * </p>
+ * 
+ * <p><b>{@code Scope}</b> is either {@link GlobalScope} or the Java class representing the
+ * complex type definition containing the schema element declaration.
+ * </p>
+ * 
+ * <p>There is a property constraint that if <b>{@code value}</b> is {@code null},
+ * then {@code nil} must be {@code true}. The converse is not true to enable
+ * representing a nil element with attribute(s). If {@code nil} is true, it is possible
+ * that {@code value} is non-null so it can hold the value of the attributes
+ * associated with a nil element.
+ * </p>
+ * 
+ * @author Kohsuke Kawaguchi, Joe Fialli
+ * @since 1.6, JAXB 2.0
+ */
+
+public class JAXBElement<T> implements Serializable {
+
+    /** xml element tag name */
+    final protected QName name;
+
+    /** Java datatype binding for xml element declaration's type. */
+    final protected Class<T> declaredType;
+
+    /** Scope of xml element declaration representing this xml element instance.
+     *  Can be one of the following values:
+     *  - {@link GlobalScope} for global xml element declaration.
+     *  - local element declaration has a scope set to the Java class 
+     *     representation of complex type defintion containing
+     *     xml element declaration. 
+     */
+    final protected Class scope;
+
+    /** xml element value. 
+        Represents content model and attributes of an xml element instance. */
+    protected T value;
+
+    /** true iff the xml element instance has xsi:nil="true". */
+    protected boolean nil = false;
+
+    /**
+     * Designates global scope for an xml element.
+     */
+    public static final class GlobalScope {}
+
+    /**
+     * <p>Construct an xml element instance.</p>
+     * 
+     * @param name          Java binding of xml element tag name
+     * @param declaredType  Java binding of xml element declaration's type
+     * @param scope
+     *      Java binding of scope of xml element declaration.
+     *      Passing null is the same as passing {@code GlobalScope.class}
+     * @param value
+     *      Java instance representing xml element's value.
+     * @see #getScope()
+     * @see #isTypeSubstituted()
+     */
+    public JAXBElement(QName name, 
+		       Class<T> declaredType, 
+		       Class scope,
+		       T value) {
+        if(declaredType==null || name==null)
+            throw new IllegalArgumentException();
+        this.declaredType = declaredType;
+        if(scope==null)     scope = GlobalScope.class;
+        this.scope = scope;
+        this.name = name;
+        setValue(value);
+    }
+
+    /**
+     * Construct an xml element instance.
+     *
+     * This is just a convenience method for {@code new JAXBElement(name,declaredType,GlobalScope.class,value)}
+     */
+    public JAXBElement(QName name, Class<T> declaredType, T value ) {
+        this(name,declaredType,GlobalScope.class,value);
+    }
+
+    /**
+     * Returns the Java binding of the xml element declaration's type attribute.
+     */
+    public Class<T> getDeclaredType() {
+        return declaredType;
+    }
+
+    /**
+     * Returns the xml element tag name.
+     */
+    public QName getName() {
+        return name;
+    }
+
+    /**
+     * <p>Set the content model and attributes of this xml element.</p>
+     *
+     * <p>When this property is set to {@code null}, {@code isNil()} must by {@code true}.
+     *    Details of constraint are described at {@link #isNil()}.</p>
+     *
+     * @see #isTypeSubstituted()
+     */
+    public void setValue(T t) {
+        this.value = t;
+    }
+
+    /**
+     * <p>Return the content model and attribute values for this element.</p>
+     * 
+     * <p>See {@link #isNil()} for a description of a property constraint when
+     * this value is {@code null}</p>
+     */
+    public T getValue() {
+        return value;
+    }
+
+    /**
+     * Returns scope of xml element declaration.
+     *
+     * @see #isGlobalScope()
+     * @return {@code GlobalScope.class} if this element is of global scope.
+     */
+    public Class getScope() {
+        return scope;
+    }
+    
+    /**
+     * <p>Returns {@code true} iff this element instance content model
+     * is nil.</p>
+     *
+     * <p>This property always returns {@code true} when {@link #getValue()} is null.
+     * Note that the converse is not true, when this property is {@code true},
+     * {@link #getValue()} can contain a non-null value for attribute(s). It is
+     * valid for a nil xml element to have attribute(s).</p>
+     */
+    public boolean isNil() {
+        return (value == null) || nil;
+    }
+
+    /**
+     * <p>Set whether this element has nil content.</p>
+     * 
+     * @see #isNil()
+     */
+    public void setNil(boolean value) {
+        this.nil = value;
+    }
+    
+    /* Convenience methods  
+     * (Not necessary but they do unambiguously conceptualize 
+     *  the rationale behind this class' fields.)
+     */
+
+    /**
+     * Returns true iff this xml element declaration is global.
+     */
+    public boolean isGlobalScope() {
+        return this.scope == GlobalScope.class;
+    }
+
+    /**
+     * Returns true iff this xml element instance's value has a different
+     * type than xml element declaration's declared type.
+     */
+    public boolean isTypeSubstituted() {
+        if(value==null)     return false;
+        return value.getClass() != declaredType;
+    }
+
+    private static final long serialVersionUID = 1L;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXBException.java b/jaxb-api/src/main/java/javax/xml/bind/JAXBException.java
new file mode 100644
index 0000000..3ca1968
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXBException.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.io.PrintWriter;
+
+/**
+ * This is the root exception class for all JAXB exceptions.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Unmarshaller
+ * @since 1.6, JAXB 1.0
+ */
+public class JAXBException extends Exception {
+  
+    /** 
+     * Vendor specific error code
+     *
+     */
+    private String errorCode;
+
+    /** 
+     * Exception reference
+     *
+     */
+    private volatile Throwable linkedException;
+
+    static final long serialVersionUID = -5621384651494307979L;
+
+    /** 
+     * Construct a JAXBException with the specified detail message.  The 
+     * errorCode and linkedException will default to null.
+     *
+     * @param message a description of the exception
+     */
+    public JAXBException(String message) {
+        this( message, null, null );
+    }
+
+    /** 
+     * Construct a JAXBException with the specified detail message and vendor 
+     * specific errorCode.  The linkedException will default to null.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     */
+    public JAXBException(String message, String errorCode) {
+        this( message, errorCode, null );
+    }
+
+    /** 
+     * Construct a JAXBException with a linkedException.  The detail message and
+     * vendor specific errorCode will default to null.
+     *
+     * @param exception the linked exception
+     */
+    public JAXBException(Throwable exception) {
+        this( null, null, exception );
+    }
+    
+    /** 
+     * Construct a JAXBException with the specified detail message and 
+     * linkedException.  The errorCode will default to null.
+     *
+     * @param message a description of the exception
+     * @param exception the linked exception
+     */
+    public JAXBException(String message, Throwable exception) {
+        this( message, null, exception );
+    }
+    
+    /** 
+     * Construct a JAXBException with the specified detail message, vendor 
+     * specific errorCode, and linkedException.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     * @param exception the linked exception
+     */
+    public JAXBException(String message, String errorCode, Throwable exception) {
+        super( message );
+        this.errorCode = errorCode;
+        this.linkedException = exception;
+    }
+    
+    /** 
+     * Get the vendor specific error code
+     *
+     * @return a string specifying the vendor specific error code
+     */
+    public String getErrorCode() {
+        return this.errorCode;
+    }
+
+    /**
+     * Get the linked exception 
+     *
+     * @return the linked Exception, null if none exists
+     */
+    public Throwable getLinkedException() {
+        return linkedException;
+    }
+
+    /**
+     * Add a linked Exception.
+     *
+     * @param exception the linked Exception (A null value is permitted and 
+     *                  indicates that the linked exception does not exist or
+     *                  is unknown).
+     */
+    public void setLinkedException( Throwable exception ) {
+        this.linkedException = exception;
+    }
+    
+    /**
+     * Returns a short description of this JAXBException.
+     *
+     */
+    public String toString() {
+        return linkedException == null ? 
+            super.toString() :
+            super.toString() + "\n - with linked exception:\n[" +
+                                linkedException.toString()+ "]";
+    }
+
+    /**
+     * Prints this JAXBException and its stack trace (including the stack trace
+     * of the linkedException if it is non-null) to the PrintStream.
+     *
+     * @param s PrintStream to use for output
+     */
+    public void printStackTrace( java.io.PrintStream s ) {
+        super.printStackTrace(s);
+    }
+
+    /**
+     * Prints this JAXBException and its stack trace (including the stack trace
+     * of the linkedException if it is non-null) to {@code System.err}.
+     *
+     */
+    public void printStackTrace() {
+        super.printStackTrace();
+    }
+
+    /**
+     * Prints this JAXBException and its stack trace (including the stack trace
+     * of the linkedException if it is non-null) to the PrintWriter.
+     *
+     * @param s PrintWriter to use for output
+     */
+    public void printStackTrace(PrintWriter s) {
+        super.printStackTrace(s);
+    }
+
+    @Override
+    public Throwable getCause() {
+        return linkedException;
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXBIntrospector.java b/jaxb-api/src/main/java/javax/xml/bind/JAXBIntrospector.java
new file mode 100644
index 0000000..13c6479
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXBIntrospector.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+import  javax.xml.namespace.QName;
+
+/**
+ * Provide access to JAXB xml binding data for a JAXB object.
+ *
+ * <p>
+ * Intially, the intent of this class is to just conceptualize how 
+ * a JAXB application developer can access xml binding information, 
+ * independent if binding model is java to schema or schema to java.
+ * Since accessing the XML element name related to a JAXB element is
+ * a highly requested feature, demonstrate access to this
+ * binding information.
+ *
+ * The factory method to get a <code>JAXBIntrospector</code> instance is 
+ * {@link JAXBContext#createJAXBIntrospector()}.
+ *
+ * @see JAXBContext#createJAXBIntrospector()
+ * @since 1.6, JAXB 2.0
+ */
+public abstract class JAXBIntrospector {
+
+    /** 
+     * <p>Return true if <code>object</code> represents a JAXB element.</p>
+     * <p>Parameter <code>object</code> is a JAXB element for following cases:
+     * <ol>
+     *   <li>It is an instance of <code>javax.xml.bind.JAXBElement</code>.</li>
+     *   <li>The class of <code>object</code> is annotated with 
+     *       <code>&#64;XmlRootElement</code>.
+     *   </li>
+     * </ol>
+     *
+     * @see #getElementName(Object)
+     */
+    public abstract boolean isElement(Object object);
+
+    /**
+     * <p>Get xml element qname for <code>jaxbElement</code>.</p>
+     *
+     * @param jaxbElement is an object that {@link #isElement(Object)} returned true.
+     *                    
+     * @return xml element qname associated with jaxbElement;
+     *         null if <code>jaxbElement</code> is not a JAXB Element.
+     */
+    public abstract QName getElementName(Object jaxbElement);
+
+    /**
+     * <p>Get the element value of a JAXB element.</p>
+     *
+     * <p>Convenience method to abstract whether working with either 
+     *    a javax.xml.bind.JAXBElement instance or an instance of 
+     *    {@code @XmlRootElement} annotated Java class.</p>
+     *
+     * @param jaxbElement  object that #isElement(Object) returns true.
+     *
+     * @return The element value of the <code>jaxbElement</code>.
+     */
+    public static Object getValue(Object jaxbElement) {
+	if (jaxbElement instanceof JAXBElement) {
+	    return ((JAXBElement)jaxbElement).getValue();
+	} else {
+	    // assume that class of this instance is 
+	    // annotated with @XmlRootElement.
+	    return jaxbElement;
+	}
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/JAXBPermission.java b/jaxb-api/src/main/java/javax/xml/bind/JAXBPermission.java
new file mode 100644
index 0000000..9b64586
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/JAXBPermission.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.security.BasicPermission;
+
+/**
+ * This class is for JAXB permissions. A {@code JAXBPermission}
+ * contains a name (also referred to as a "target name") but
+ * no actions list; you either have the named permission
+ * or you don't.
+ *
+ * <P>
+ * The target name is the name of the JAXB permission (see below).
+ *
+ * <P>
+ * The following table lists all the possible {@code JAXBPermission} target names,
+ * and for each provides a description of what the permission allows
+ * and a discussion of the risks of granting code the permission.
+ *
+ * <table class="striped">
+ * <caption style="display:none">Permission target name, what the permission allows, and associated risks"</caption>
+ * <thead>
+ * <tr>
+ * <th scope="col">Permission Target Name</th>
+ * <th scope="col">What the Permission Allows</th>
+ * <th scope="col">Risks of Allowing this Permission</th>
+ * </tr>
+ * </thead>
+ *
+ * <tbody style="text-align:left">
+ * <tr>
+ *   <th scope="row">setDatatypeConverter</th>
+ *   <td>
+ *     Allows the code to set VM-wide {@link DatatypeConverterInterface}
+ *     via {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) the setDatatypeConverter method}
+ *     that all the methods on {@link DatatypeConverter} uses.
+ *   </td>
+ *   <td>
+ *     Malicious code can set {@link DatatypeConverterInterface}, which has
+ *     VM-wide singleton semantics,  before a genuine JAXB implementation sets one.
+ *     This allows malicious code to gain access to objects that it may otherwise
+ *     not have access to, such as {@link java.awt.Frame#getFrames()} that belongs to
+ *     another application running in the same JVM.
+ *   </td>
+ * </tr>
+ * </tbody>
+ * </table>
+ *
+ * @see java.security.BasicPermission
+ * @see java.security.Permission
+ * @see java.security.Permissions
+ * @see java.security.PermissionCollection
+ * @see java.lang.SecurityManager
+ *
+ * @author Joe Fialli
+ * @since 1.7, JAXB 2.2
+ */
+
+/* code was borrowed originally from java.lang.RuntimePermission. */
+public final class JAXBPermission extends BasicPermission {
+    /**
+     * Creates a new JAXBPermission with the specified name.
+     *
+     * @param name
+     * The name of the JAXBPermission. As of 2.2 only "setDatatypeConverter"
+     * is defined.
+     */
+    public JAXBPermission(String name) {
+        super(name);
+    }
+
+    private static final long serialVersionUID = 1L;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/MarshalException.java b/jaxb-api/src/main/java/javax/xml/bind/MarshalException.java
new file mode 100644
index 0000000..adcab34
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/MarshalException.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * a marshal operation that the provider is unable to recover from.
+ * 
+ * <p>
+ * The {@code ValidationEventHandler} can cause this exception to be thrown
+ * during the marshal operations.  See 
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBException
+ * @see Marshaller
+ * @since 1.6, JAXB 1.0
+ */
+public class MarshalException extends JAXBException {
+
+    /** 
+     * Construct a MarshalException with the specified detail message.  The 
+     * errorCode and linkedException will default to null.
+     *
+     * @param message a description of the exception
+     */
+    public MarshalException( String message ) {
+        this( message, null, null );
+    }
+
+    /** 
+     * Construct a MarshalException with the specified detail message and vendor 
+     * specific errorCode.  The linkedException will default to null.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     */
+    public MarshalException( String message, String errorCode ) {
+        this( message, errorCode, null );
+    }
+
+    /** 
+     * Construct a MarshalException with a linkedException.  The detail message and
+     * vendor specific errorCode will default to null.
+     *
+     * @param exception the linked exception
+     */
+    public MarshalException( Throwable exception ) {
+        this( null, null, exception );
+    }
+    
+    /** 
+     * Construct a MarshalException with the specified detail message and 
+     * linkedException.  The errorCode will default to null.
+     *
+     * @param message a description of the exception
+     * @param exception the linked exception
+     */
+    public MarshalException( String message, Throwable exception ) {
+        this( message, null, exception );
+    }
+    
+    /** 
+     * Construct a MarshalException with the specified detail message, vendor 
+     * specific errorCode, and linkedException.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     * @param exception the linked exception
+     */
+    public MarshalException( String message, String errorCode, Throwable exception ) {
+        super( message, errorCode, exception );
+    }
+
+}
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/Marshaller.java b/jaxb-api/src/main/java/javax/xml/bind/Marshaller.java
new file mode 100644
index 0000000..8e9d343
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/Marshaller.java
@@ -0,0 +1,811 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.validation.Schema;
+import java.io.File;
+
+/**
+ * <p>
+ * The {@code Marshaller} class is responsible for governing the process
+ * of serializing Java content trees back into XML data.  It provides the basic
+ * marshalling methods:
+ *
+ * <p>
+ * <i>Assume the following setup code for all following code fragments:</i>
+ * <blockquote>
+ *    <pre>
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ *       Object element = u.unmarshal( new File( "foo.xml" ) );
+ *       Marshaller m = jc.createMarshaller();
+ *    </pre>
+ * </blockquote>
+ * 
+ * <p>
+ * Marshalling to a File:
+ * <blockquote>
+ *    <pre>
+ *       OutputStream os = new FileOutputStream( "nosferatu.xml" );
+ *       m.marshal( element, os );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a SAX ContentHandler:
+ * <blockquote>
+ *    <pre>
+ *       // assume MyContentHandler instanceof ContentHandler
+ *       m.marshal( element, new MyContentHandler() );  
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a DOM Node:
+ * <blockquote>
+ *    <pre>
+ *       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ *       dbf.setNamespaceAware(true);
+ *       DocumentBuilder db = dbf.newDocumentBuilder();
+ *       Document doc = db.newDocument();
+ *
+ *       m.marshal( element, doc );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a java.io.OutputStream:
+ * <blockquote>
+ *    <pre>
+ *       m.marshal( element, System.out );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a java.io.Writer:
+ * <blockquote>
+ *    <pre>
+ *       m.marshal( element, new PrintWriter( System.out ) );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.SAXResult:
+ * <blockquote>
+ *    <pre>
+ *       // assume MyContentHandler instanceof ContentHandler
+ *       SAXResult result = new SAXResult( new MyContentHandler() );
+ *
+ *       m.marshal( element, result );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.DOMResult:
+ * <blockquote>
+ *    <pre>
+ *       DOMResult result = new DOMResult();
+ *       
+ *       m.marshal( element, result );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.StreamResult:
+ * <blockquote>
+ *    <pre>
+ *       StreamResult result = new StreamResult( System.out );
+ * 
+ *       m.marshal( element, result );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.stream.XMLStreamWriter:
+ * <blockquote>
+ *    <pre>
+ *       XMLStreamWriter xmlStreamWriter = 
+ *           XMLOutputFactory.newInstance().createXMLStreamWriter( ... );
+ * 
+ *       m.marshal( element, xmlStreamWriter );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.stream.XMLEventWriter:
+ * <blockquote>
+ *    <pre>
+ *       XMLEventWriter xmlEventWriter = 
+ *           XMLOutputFactory.newInstance().createXMLEventWriter( ... );
+ * 
+ *       m.marshal( element, xmlEventWriter );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="elementMarshalling"></a>
+ * <b>Marshalling content tree rooted by a JAXB element</b><br>
+ * <blockquote>
+ * The first parameter of the overloaded
+ * {@code Marshaller.marshal(java.lang.Object, ...)} methods must be a
+ * JAXB element as computed by 
+ * {@link JAXBIntrospector#isElement(java.lang.Object)};
+ * otherwise, a {@code Marshaller.marshal} method must throw a
+ * {@link MarshalException}. There exist two mechanisms 
+ * to enable marshalling an instance that is not a JAXB element.
+ * One method is to wrap the instance as a value of a {@link JAXBElement}, 
+ * and pass the wrapper element as the first parameter to
+ * a {@code Marshaller.marshal} method. For java to schema binding, it
+ * is also possible to simply annotate the instance's class with 
+ * &#64;{@link XmlRootElement}.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Encoding</b><br>
+ * <blockquote>
+ * By default, the Marshaller will use UTF-8 encoding when generating XML data
+ * to a {@code java.io.OutputStream}, or a {@code java.io.Writer}.  Use the
+ * {@link #setProperty(String,Object) setProperty} API to change the output 
+ * encoding used during these marshal operations.  Client applications are
+ * expected to supply a valid character encoding name as defined in the
+ * <a href="http://www.w3.org/TR/2000/REC-xml-20001006#charencoding">W3C XML 1.0
+ * Recommendation</a> and supported by your Java Platform.
+ * </blockquote>
+ * 
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * Client applications are not required to validate the Java content tree prior
+ * to calling any of the marshal API's.  Furthermore, there is no requirement 
+ * that the Java content tree be valid with respect to its original schema in
+ * order to marshal it back into XML data.  Different JAXB Providers will 
+ * support marshalling invalid Java content trees at varying levels, however
+ * all JAXB Providers must be able to marshal a valid content tree back to 
+ * XML data.  A JAXB Provider must throw a {@code MarshalException} when it
+ * is unable to complete the marshal operation due to invalid content.  Some
+ * JAXB Providers will fully allow marshalling invalid content, others will fail
+ * on the first validation error.
+ * <p>
+ * Even when schema validation is not explictly enabled for the marshal operation,
+ * it is possible that certain types of validation events will be detected 
+ * during the operation.  Validation events will be reported to the registered
+ * event handler.  If the client application has not registered an event handler
+ * prior to invoking one of the marshal API's, then events will be delivered to
+ * a default event handler which will terminate the marshal operation after
+ * encountering the first error or fatal error. Note that for JAXB 2.0 and
+ * later versions, {@link javax.xml.bind.helpers.DefaultValidationEventHandler} is
+ * no longer used.
+ * 
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * All JAXB Providers are required to support the following set of properties.
+ * Some providers may support additional properties.
+ * <dl>
+ *   <dt>{@code jaxb.encoding} - value must be a java.lang.String</dt>
+ *   <dd>The output encoding to use when marshalling the XML data.  The
+ * 		 Marshaller will use "UTF-8" by default if this property is not
+ *  	 specified.</dd>
+ *   <dt>{@code jaxb.formatted.output} - value must be a java.lang.Boolean</dt>
+ *   <dd>This property controls whether or not the Marshaller will format
+ * 	 the resulting XML data with line breaks and indentation.  A
+ *       true value for this property indicates human readable indented 
+ *       xml data, while a false value indicates unformatted xml data.
+ *       The Marshaller will default to false (unformatted) if this 
+ *       property is not specified.</dd>
+ *   <dt>{@code jaxb.schemaLocation} - value must be a java.lang.String</dt>
+ *   <dd>This property allows the client application to specify an
+ *       xsi:schemaLocation attribute in the generated XML data.  The format of 
+ *       the schemaLocation attribute value is discussed in an easy to 
+ *       understand, non-normative form in 
+ *       <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6 
+ *       of the W3C XML Schema Part 0: Primer</a> and specified in 
+ *       <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ *       Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+ *   <dt>{@code jaxb.noNamespaceSchemaLocation} - value must be a java.lang.String</dt>
+ *   <dd>This property allows the client application to specify an
+ *       xsi:noNamespaceSchemaLocation attribute in the generated XML 
+ *       data.  The format of the schemaLocation attribute value is discussed in 
+ *       an easy to understand, non-normative form in 
+ *       <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6 
+ *       of the W3C XML Schema Part 0: Primer</a> and specified in 
+ *       <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ *       Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+ *   <dt>{@code jaxb.fragment} - value must be a java.lang.Boolean</dt>
+ *   <dd>This property determines whether or not document level events will be
+ *       generated by the Marshaller.  If the property is not specified, the 
+ *       default is {@code false}. This property has different implications depending
+ *       on which marshal api you are using - when this property is set to true:<br>
+ *       <ul>
+ *         <li>{@link #marshal(Object,org.xml.sax.ContentHandler) marshal(Object,ContentHandler)} - the Marshaller won't
+ *             invoke {@link org.xml.sax.ContentHandler#startDocument()} and
+ *             {@link org.xml.sax.ContentHandler#endDocument()}.</li>
+ *         <li>{@link #marshal(Object,org.w3c.dom.Node) marshal(Object,Node)} - the property has no effect on this
+ *             API.</li>
+ *         <li>{@link #marshal(Object,java.io.OutputStream) marshal(Object,OutputStream)} - the Marshaller won't
+ *             generate an xml declaration.</li>
+ *         <li>{@link #marshal(Object,java.io.Writer) marshal(Object,Writer)} - the Marshaller won't
+ *             generate an xml declaration.</li>
+ *         <li>{@link #marshal(Object,javax.xml.transform.Result) marshal(Object,Result)} - depends on the kind of
+ *             Result object, see semantics for Node, ContentHandler, and Stream APIs</li>
+ *         <li>{@link #marshal(Object,javax.xml.stream.XMLEventWriter) marshal(Object,XMLEventWriter)} - the
+ *             Marshaller will not generate {@link javax.xml.stream.events.XMLEvent#START_DOCUMENT} and
+ *             {@link javax.xml.stream.events.XMLEvent#END_DOCUMENT} events.</li>
+ *         <li>{@link #marshal(Object,javax.xml.stream.XMLStreamWriter) marshal(Object,XMLStreamWriter)} - the
+ *             Marshaller will not generate {@link javax.xml.stream.events.XMLEvent#START_DOCUMENT} and
+ *             {@link javax.xml.stream.events.XMLEvent#END_DOCUMENT} events.</li>
+ *       </ul>
+ *   </dd>
+ * </dl>
+ * </blockquote>
+ * 
+ * <p>
+ * <a name="marshalEventCallback"></a>
+ * <b>Marshal Event Callbacks</b><br>
+ * <blockquote>
+ * "The {@link Marshaller} provides two styles of callback mechanisms
+ * that allow application specific processing during key points in the
+ * unmarshalling process.  In 'class defined' event callbacks, application
+ * specific code placed in JAXB mapped classes is triggered during
+ * marshalling.  'External listeners' allow for centralized processing
+ * of marshal events in one callback method rather than by type event callbacks.
+ *
+ * <p>
+ * Class defined event callback methods allow any JAXB mapped class to specify 
+ * its own specific callback methods by defining methods with the following method signatures:
+ * <blockquote>
+ * <pre>
+ *   // Invoked by Marshaller after it has created an instance of this object.
+ *   boolean beforeMarshal(Marshaller);
+ * 
+ *   // Invoked by Marshaller after it has marshalled all properties of this object.
+ *   void afterMarshal(Marshaller);
+ * </pre>
+ * </blockquote>
+ * The class defined event callback methods should be used when the callback method requires
+ * access to non-public methods and/or fields of the class. 
+ * <p>
+ * The external listener callback mechanism enables the registration of a {@link Listener} 
+ * instance with a {@link Marshaller#setListener(Listener)}. The external listener receives all callback events, 
+ * allowing for more centralized processing than per class defined callback methods.
+ * <p>
+ * The 'class defined' and external listener event callback methods are independent of each other,
+ * both can be called for one event. The invocation ordering when both listener callback methods exist is
+ * defined in {@link Listener#beforeMarshal(Object)} and {@link Listener#afterMarshal(Object)}.
+ * <p>
+ * An event callback method throwing an exception terminates the current marshal process.
+ * </blockquote>
+ * 
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBContext
+ * @see Validator
+ * @see Unmarshaller
+ * @since 1.6, JAXB 1.0
+ */
+public interface Marshaller {
+
+    /**
+     * The name of the property used to specify the output encoding in
+     * the marshalled XML data.
+     */
+    public static final String JAXB_ENCODING =
+        "jaxb.encoding";
+
+    /**
+     * The name of the property used to specify whether or not the marshalled 
+     * XML data is formatted with linefeeds and indentation. 
+     */
+    public static final String JAXB_FORMATTED_OUTPUT =
+        "jaxb.formatted.output";
+
+    /**
+     * The name of the property used to specify the xsi:schemaLocation
+     * attribute value to place in the marshalled XML output.
+     */
+    public static final String JAXB_SCHEMA_LOCATION =
+        "jaxb.schemaLocation";
+
+    /**
+     * The name of the property used to specify the
+     * xsi:noNamespaceSchemaLocation attribute value to place in the marshalled
+     * XML output.
+     */
+    public static final String JAXB_NO_NAMESPACE_SCHEMA_LOCATION =
+        "jaxb.noNamespaceSchemaLocation";
+
+    /**
+     * The name of the property used to specify whether or not the marshaller
+     * will generate document level events (ie calling startDocument or endDocument).
+     */
+    public static final String JAXB_FRAGMENT =
+        "jaxb.fragment";
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into the specified
+     * {@code javax.xml.transform.Result}.
+     * 
+     * <p>
+     * All JAXB Providers must at least support
+     * {@link javax.xml.transform.dom.DOMResult},
+     * {@link javax.xml.transform.sax.SAXResult}, and
+     * {@link javax.xml.transform.stream.StreamResult}. It can 
+     * support other derived classes of {@code Result} as well.
+     * 
+     * @param jaxbElement
+     *      The root of content tree to be marshalled. 
+     * @param result
+     *      XML will be sent to this Result
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     */
+    public void marshal( Object jaxbElement, javax.xml.transform.Result result )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into an output stream.
+     * 
+     * @param jaxbElement
+     *      The root of content tree to be marshalled. 
+     * @param os
+     *      XML will be added to this stream.
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     */
+    public void marshal( Object jaxbElement, java.io.OutputStream os )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into a file.
+     *
+     * @param jaxbElement
+     *      The root of content tree to be marshalled.
+     * @param output
+     *      File to be written. If this file already exists, it will be overwritten.
+     *
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     * @since 1.6, JAXB 2.1
+     */
+    public void marshal( Object jaxbElement, File output )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into a Writer.
+     * 
+     * @param jaxbElement
+     *      The root of content tree to be marshalled. 
+     * @param writer
+     *      XML will be sent to this writer.
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     */
+    public void marshal( Object jaxbElement, java.io.Writer writer )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into SAX2 events.
+     * 
+     * @param jaxbElement
+     *      The root of content tree to be marshalled. 
+     * @param handler
+     *      XML will be sent to this handler as SAX2 events.
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     */
+    public void marshal( Object jaxbElement, org.xml.sax.ContentHandler handler )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into a DOM tree.
+     * 
+     * @param jaxbElement
+     *      The content tree to be marshalled. 
+     * @param node
+     *      DOM nodes will be added as children of this node.
+     *      This parameter must be a Node that accepts children
+     *      ({@link org.w3c.dom.Document},
+     *      {@link  org.w3c.dom.DocumentFragment}, or
+     *      {@link  org.w3c.dom.Element})
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     */
+    public void marshal( Object jaxbElement, org.w3c.dom.Node node )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into a
+     * {@link javax.xml.stream.XMLStreamWriter}.
+     * 
+     * @param jaxbElement
+     *      The content tree to be marshalled. 
+     * @param writer
+     *      XML will be sent to this writer.
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     * @since 1.6, JAXB 2.0
+     */
+    public void marshal( Object jaxbElement, javax.xml.stream.XMLStreamWriter writer )
+        throws JAXBException;
+
+    /**
+     * Marshal the content tree rooted at {@code jaxbElement} into a
+     * {@link javax.xml.stream.XMLEventWriter}.
+     * 
+     * @param jaxbElement
+     *      The content tree rooted at jaxbElement to be marshalled. 
+     * @param writer
+     *      XML will be sent to this writer.
+     * 
+     * @throws JAXBException
+     *      If any unexpected problem occurs during the marshalling.
+     * @throws MarshalException
+     *      If the {@link ValidationEventHandler ValidationEventHandler}
+     *      returns false from its {@code handleEvent} method or the
+     *      {@code Marshaller} is unable to marshal {@code jaxbElement} (or any
+     *      object reachable from {@code jaxbElement}).  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#elementMarshalling">
+     *      Marshalling a JAXB element</a>.
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     * @since 1.6, JAXB 2.0
+     */
+    public void marshal( Object jaxbElement, javax.xml.stream.XMLEventWriter writer )
+        throws JAXBException;
+
+    /**
+     * Get a DOM tree view of the content tree(Optional).
+     * 
+     * If the returned DOM tree is updated, these changes are also 
+     * visible in the content tree. 
+     * Use {@link #marshal(Object, org.w3c.dom.Node)} to force
+     * a deep copy of the content tree to a DOM representation.
+     * 
+     * @param contentTree - JAXB Java representation of XML content
+     * 
+     * @return the DOM tree view of the contentTree
+     * 
+     * @throws UnsupportedOperationException
+     *      If the JAXB provider implementation does not support a
+     *      DOM view of the content tree
+     * 
+     * @throws IllegalArgumentException
+     *      If any of the method parameters are null
+     *
+     * @throws JAXBException
+     *      If any unexpected problem occurs
+     *
+     */
+    public org.w3c.dom.Node getNode( java.lang.Object contentTree )
+        throws JAXBException;
+
+    /**
+     * Set the particular property in the underlying implementation of 
+     * {@code Marshaller}.  This method can only be used to set one of
+     * the standard JAXB defined properties above or a provider specific
+     * property.  Attempting to set an undefined property will result in
+     * a PropertyException being thrown.  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#supportedProps">
+     * Supported Properties</a>.
+     *
+     * @param name the name of the property to be set. This value can either
+     *              be specified using one of the constant fields or a user 
+     *              supplied string.
+     * @param value the value of the property to be set
+     *
+     * @throws PropertyException when there is an error processing the given
+     *                            property or value
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     */
+    public void setProperty( String name, Object value )
+        throws PropertyException;
+
+    /**
+     * Get the particular property in the underlying implementation of 
+     * {@code Marshaller}.  This method can only be used to get one of
+     * the standard JAXB defined properties above or a provider specific
+     * property.  Attempting to get an undefined property will result in
+     * a PropertyException being thrown.  See <a href="{@docRoot}/javax/xml/bind/Marshaller.html#supportedProps">
+     * Supported Properties</a>.
+     *
+     * @param name the name of the property to retrieve
+     * @return the value of the requested property
+     *
+     * @throws PropertyException
+     *      when there is an error retrieving the given property or value
+     *      property name
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     */
+    public Object getProperty( String name ) throws PropertyException;
+
+    /**
+     * Allow an application to register a validation event handler.
+     * <p>
+     * The validation event handler will be called by the JAXB Provider if any
+     * validation errors are encountered during calls to any of the marshal
+     * API's.  If the client application does not register a validation event 
+     * handler before invoking one of the marshal methods, then validation 
+     * events will be handled by the default event handler which will terminate 
+     * the marshal operation after the first error or fatal error is encountered.
+     * <p>
+     * Calling this method with a null parameter will cause the Marshaller
+     * to revert back to the default default event handler.
+     * 
+     * @param handler the validation event handler
+     * @throws JAXBException if an error was encountered while setting the
+     *         event handler
+     */
+    public void setEventHandler( ValidationEventHandler handler )
+        throws JAXBException;
+
+    /**
+     * Return the current event handler or the default event handler if one
+     * hasn't been set.
+     *
+     * @return the current ValidationEventHandler or the default event handler
+     *         if it hasn't been set
+     * @throws JAXBException if an error was encountered while getting the 
+     *         current event handler
+     */
+    public ValidationEventHandler getEventHandler()
+        throws JAXBException;
+
+
+
+    /**
+     * Associates a configured instance of {@link XmlAdapter} with this marshaller.
+     *
+     * <p>
+     * This is a convenience method that invokes {@code setAdapter(adapter.getClass(),adapter);}.
+     *
+     * @see #setAdapter(Class,XmlAdapter)
+     * @throws IllegalArgumentException
+     *      if the adapter parameter is null.
+     * @throws UnsupportedOperationException
+     *      if invoked agains a JAXB 1.0 implementation.
+     * @since 1.6, JAXB 2.0
+     */
+    public void setAdapter( XmlAdapter adapter );
+
+    /**
+     * Associates a configured instance of {@link XmlAdapter} with this marshaller.
+     *
+     * <p>
+     * Every marshaller internally maintains a
+     * {@link java.util.Map}&lt;{@link Class},{@link XmlAdapter}&gt;,
+     * which it uses for marshalling classes whose fields/methods are annotated
+     * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
+     *
+     * <p>
+     * This method allows applications to use a configured instance of {@link XmlAdapter}.
+     * When an instance of an adapter is not given, a marshaller will create
+     * one by invoking its default constructor.
+     *
+     * @param type
+     *      The type of the adapter. The specified instance will be used when
+     *      {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
+     *      refers to this type.
+     * @param adapter
+     *      The instance of the adapter to be used. If null, it will un-register
+     *      the current adapter set for this type.
+     * @throws IllegalArgumentException
+     *      if the type parameter is null.
+     * @throws UnsupportedOperationException
+     *      if invoked agains a JAXB 1.0 implementation.
+     * @since 1.6, JAXB 2.0
+     */
+    public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
+
+    /**
+     * Gets the adapter associated with the specified type.
+     *
+     * This is the reverse operation of the {@link #setAdapter} method.
+     *
+     * @throws IllegalArgumentException
+     *      if the type parameter is null.
+     * @throws UnsupportedOperationException
+     *      if invoked agains a JAXB 1.0 implementation.
+     * @since 1.6, JAXB 2.0
+     */
+    public <A extends XmlAdapter> A getAdapter( Class<A> type );
+
+
+    /**
+     * <p>Associate a context that enables binary data within an XML document
+     * to be transmitted as XML-binary optimized attachment.
+     * The attachment is referenced from the XML document content model
+     * by content-id URIs(cid) references stored within the xml document.
+     *
+     * @throws IllegalStateException if attempt to concurrently call this
+     *                               method during a marshal operation.
+     */
+    void setAttachmentMarshaller(AttachmentMarshaller am);
+
+    AttachmentMarshaller getAttachmentMarshaller();
+
+    /**
+     * Specify the JAXP 1.3 {@link javax.xml.validation.Schema Schema}
+     * object that should be used to validate subsequent marshal operations
+     * against.  Passing null into this method will disable validation.
+     *
+     * <p>
+     * This method allows the caller to validate the marshalled XML as it's marshalled.
+     *
+     * <p>
+     * Initially this property is set to {@code null}.
+     *
+     * @param schema Schema object to validate marshal operations against or null to disable validation
+     * @throws UnsupportedOperationException could be thrown if this method is
+     *         invoked on an Marshaller created from a JAXBContext referencing
+     *         JAXB 1.0 mapped classes
+     * @since 1.6, JAXB 2.0
+     */
+    public void setSchema( Schema schema );
+
+    /**
+     * Get the JAXP 1.3 {@link javax.xml.validation.Schema Schema} object
+     * being used to perform marshal-time validation.  If there is no
+     * Schema set on the marshaller, then this method will return null
+     * indicating that marshal-time validation will not be performed.
+     *
+     * @return the Schema object being used to perform marshal-time
+     *      validation or null if not present.
+     * @throws UnsupportedOperationException could be thrown if this method is
+     *         invoked on an Marshaller created from a JAXBContext referencing
+     *         JAXB 1.0 mapped classes
+     * @since 1.6, JAXB 2.0
+     */
+    public Schema getSchema();
+
+    /**
+     * <p>
+     * Register an instance of an implementation of this class with a {@link Marshaller} to externally listen
+     * for marshal events.
+     * </p>
+     * <p>
+     * This class enables pre and post processing of each marshalled object.
+     * The event callbacks are called when marshalling from an instance that maps to an xml element or
+     * complex type definition. The event callbacks are not called when marshalling from an instance of a
+     * Java datatype that represents a simple type definition.
+     * </p>
+     * <p>
+     * External listener is one of two different mechanisms for defining marshal event callbacks.
+     * See <a href="Marshaller.html#marshalEventCallback">Marshal Event Callbacks</a> for an overview.
+     *
+     * @see Marshaller#setListener(Listener)
+     * @see Marshaller#getListener()
+     * @since 1.6, JAXB 2.0
+     */
+    public static abstract class Listener {
+        /**
+         * <p>
+         * Callback method invoked before marshalling from {@code source} to XML.
+         * </p>
+         * <p>
+         * This method is invoked just before marshalling process starts to marshal {@code source}.
+         * Note that if the class of {@code source} defines its own {@code beforeMarshal} method,
+         * the class specific callback method is invoked just before this method is invoked.
+         *
+         * @param source instance of JAXB mapped class prior to marshalling from it.
+         */
+        public void beforeMarshal(Object source) {
+        }
+
+        /**
+         * <p>
+         * Callback method invoked after marshalling {@code source} to XML.
+         * </p>
+         * <p>
+         * This method is invoked after {@code source} and all its descendants have been marshalled.
+         * Note that if the class of {@code source} defines its own {@code afterMarshal} method,
+         * the class specific callback method is invoked just before this method is invoked.
+         *
+         * @param source instance of JAXB mapped class after marshalling it.
+         */
+        public void afterMarshal(Object source) {
+        }
+    }
+
+    /**
+     * <p>
+     * Register marshal event callback {@link Listener} with this {@link Marshaller}.
+     * 
+     * <p>
+     * There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener.
+     * One can unregister current Listener by setting listener to {@code null}.
+     *
+     * @param listener an instance of a class that implements {@link Listener}
+     * @since 1.6, JAXB 2.0
+     */
+    public void setListener(Listener listener);
+
+    /**
+     * <p>Return {@link Listener} registered with this {@link Marshaller}.
+     * 
+     * @return registered {@link Listener} or {@code null}
+     *         if no Listener is registered with this Marshaller.
+     * @since 1.6, JAXB 2.0
+     */
+    public Listener getListener();
+}
+
+
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/Messages.java b/jaxb-api/src/main/java/javax/xml/bind/Messages.java
new file mode 100644
index 0000000..d42909f
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/Messages.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+    static String format( String property ) {
+        return format( property, null );
+    }
+    
+    static String format( String property, Object arg1 ) {
+        return format( property, new Object[]{arg1} );
+    }
+    
+    static String format( String property, Object arg1, Object arg2 ) {
+        return format( property, new Object[]{arg1,arg2} );
+    }
+    
+    static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+        return format( property, new Object[]{arg1,arg2,arg3} );
+    }
+    
+    // add more if necessary.
+    
+    /** Loads a string resource and formats it with specified arguments. */
+    static String format( String property, Object[] args ) {
+        String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+        return MessageFormat.format(text,args);
+    }
+    
+//
+//
+// Message resources
+//
+//
+    static final String PROVIDER_NOT_FOUND = // 1 arg
+        "ContextFinder.ProviderNotFound";
+
+    static final String DEFAULT_PROVIDER_NOT_FOUND = // 0 args
+        "ContextFinder.DefaultProviderNotFound";
+
+    static final String COULD_NOT_INSTANTIATE = // 2 args
+        "ContextFinder.CouldNotInstantiate";
+        
+    static final String CANT_FIND_PROPERTIES_FILE = // 1 arg
+        "ContextFinder.CantFindPropertiesFile";
+        
+    static final String CANT_MIX_PROVIDERS = // 0 args
+        "ContextFinder.CantMixProviders";
+        
+    static final String MISSING_PROPERTY = // 2 args
+        "ContextFinder.MissingProperty";
+
+    static final String NO_PACKAGE_IN_CONTEXTPATH = // 0 args
+        "ContextFinder.NoPackageInContextPath";
+
+    static final String NAME_VALUE = // 2 args
+        "PropertyException.NameValue";
+        
+    static final String CONVERTER_MUST_NOT_BE_NULL = // 0 args
+        "DatatypeConverter.ConverterMustNotBeNull";
+
+    static final String ILLEGAL_CAST = // 2 args
+        "JAXBContext.IllegalCast";
+
+    static final String ERROR_LOAD_CLASS = // 2 args
+            "ContextFinder.ErrorLoadClass";
+
+    static final String JAXB_CLASSES_NOT_OPEN = // 1 arg
+            "JAXBClasses.notOpen";
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ModuleUtil.java b/jaxb-api/src/main/java/javax/xml/bind/ModuleUtil.java
new file mode 100644
index 0000000..1ecc931
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ModuleUtil.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.io.IOException;
+
+/**
+ * Intended to be overridden on JDK9, with JEP 238 multi-release class copy.
+ * Contains only stubs for methods needed on JDK9 runtime.
+ *
+ * @author Roman Grigoriadi
+ */
+class ModuleUtil {
+
+    /**
+     * Resolves classes from context path.
+     * Only one class per package is needed to access its {@link java.lang.Module}
+     */
+    static Class[] getClassesFromContextPath(String contextPath, ClassLoader classLoader) throws JAXBException {
+        return null;
+    }
+
+    /**
+     * Find first class in package by {@code jaxb.index} file.
+     */
+    static Class findFirstByJaxbIndex(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
+        return null;
+    }
+
+    /**
+     * Implementation may be defined in other module than {@code java.xml.bind}. In that case openness
+     * {@linkplain java.lang.Module#isOpen open} of classes should be delegated to implementation module.
+     *
+     * @param classes used to resolve module for {@linkplain java.lang.Module#addOpens(String, java.lang.Module)}
+     * @param factorySPI used to resolve {@link java.lang.Module} of the implementation.
+     */
+    static void delegateAddOpensToImplModule(Class[] classes, Class<?> factorySPI) {
+        //stub
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/NotIdentifiableEvent.java b/jaxb-api/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
new file mode 100644
index 0000000..7c04b82
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered resolving an ID/IDREF.
+ * 
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since 1.6, JAXB 1.0
+ */
+public interface NotIdentifiableEvent extends ValidationEvent {
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ParseConversionEvent.java b/jaxb-api/src/main/java/javax/xml/bind/ParseConversionEvent.java
new file mode 100644
index 0000000..0bc3de0
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ParseConversionEvent.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while converting a
+ * string from the XML data into a value of the target Java data type.
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see ValidationEvent
+ * @see ValidationEventHandler
+ * @see Unmarshaller
+ * @since 1.6, JAXB 1.0
+ */
+public interface ParseConversionEvent extends ValidationEvent {
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/PrintConversionEvent.java b/jaxb-api/src/main/java/javax/xml/bind/PrintConversionEvent.java
new file mode 100644
index 0000000..6531e22
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/PrintConversionEvent.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while converting data
+ * from the Java content tree into its lexical representation.
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see ValidationEvent
+ * @see ValidationEventHandler
+ * @see Marshaller
+ * @since 1.6, JAXB 1.0
+ */
+public interface PrintConversionEvent extends ValidationEvent {
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/PropertyException.java b/jaxb-api/src/main/java/javax/xml/bind/PropertyException.java
new file mode 100644
index 0000000..1d34269
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/PropertyException.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+
+
+/**
+ * This exception indicates that an error was encountered while getting or
+ * setting a property.
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBContext
+ * @see Validator
+ * @see Unmarshaller
+ * @since 1.6, JAXB 1.0
+ */
+public class PropertyException extends JAXBException {
+    
+    /** 
+     * Construct a PropertyException with the specified detail message.  The 
+     * errorCode and linkedException will default to null.
+     *
+     * @param message a description of the exception
+     */
+    public PropertyException(String message) {
+    	super(message);
+    }
+    
+    /** 
+     * Construct a PropertyException with the specified detail message and 
+     * vendor specific errorCode.  The linkedException will default to null.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     */
+    public PropertyException(String message, String errorCode) {
+    	super(message, errorCode);
+    }
+    
+    /** 
+     * Construct a PropertyException with a linkedException.  The detail 
+     * message and vendor specific errorCode will default to null.
+     *
+     * @param exception the linked exception
+     */
+    public PropertyException(Throwable exception) {
+    	super(exception);
+    }
+    
+    /** 
+     * Construct a PropertyException with the specified detail message and 
+     * linkedException.  The errorCode will default to null.
+     *
+     * @param message a description of the exception
+     * @param exception the linked exception
+     */
+    public PropertyException(String message, Throwable exception) {
+    	super(message, exception);
+    }
+    
+    /** 
+     * Construct a PropertyException with the specified detail message, vendor 
+     * specific errorCode, and linkedException.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     * @param exception the linked exception
+     */
+    public PropertyException(
+    	String message,
+    	String errorCode,
+    	Throwable exception) {
+    	super(message, errorCode, exception);
+    }
+    
+    /**
+     * Construct a PropertyException whose message field is set based on the 
+     * name of the property and value.toString(). 
+     * 
+     * @param name the name of the property related to this exception
+     * @param value the value of the property related to this exception
+     */
+    public PropertyException(String name, Object value) {
+    	super( Messages.format( Messages.NAME_VALUE, 
+                                        name, 
+                                        value.toString() ) );
+    }
+    
+    
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/SchemaOutputResolver.java b/jaxb-api/src/main/java/javax/xml/bind/SchemaOutputResolver.java
new file mode 100644
index 0000000..f922dfe
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/SchemaOutputResolver.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import javax.xml.transform.Result;
+import java.io.IOException;
+
+/**
+ * Controls where a JAXB implementation puts the generates
+ * schema files.
+ *
+ * <p>
+ * An implementation of this abstract class has to be provided by the calling
+ * application to generate schemas.
+ *
+ * <p>
+ * This is a class, not an interface so as to allow future versions to evolve
+ * without breaking the compatibility.
+ *
+ * @author
+ *     Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 1.6
+ */
+public abstract class SchemaOutputResolver {
+    /**
+     * Decides where the schema file (of the given namespace URI)
+     * will be written, and return it as a {@link Result} object.
+     *
+     * <p>
+     * This method is called only once for any given namespace.
+     * IOW, all the components in one namespace is always written
+     * into the same schema document.
+     *
+     * @param namespaceUri
+     *      The namespace URI that the schema declares.
+     *      Can be the empty string, but never be null.
+     * @param suggestedFileName
+     *      A JAXB implementation generates an unique file name (like "schema1.xsd")
+     *      for the convenience of the callee. This name can be
+     *      used for the file name of the schema, or the callee can just
+     *      ignore this name and come up with its own name.
+     *      This is just a hint.
+     *
+     * @return
+     *      a {@link Result} object that encapsulates the actual destination
+     *      of the schema.
+     *
+     *      If the {@link Result} object has a system ID, it must be an
+     *      absolute system ID. Those system IDs are relativized by the caller and used
+     *      for {@literal <xs:import>} statements.
+     *
+     *      If the {@link Result} object does not have a system ID, a schema
+     *      for the namespace URI is generated but it won't be explicitly
+     *      {@literal <xs:import>}ed from other schemas.
+     *
+     *      If {@code null} is returned, the schema generation for this
+     *      namespace URI will be skipped.
+     */
+    public abstract Result createOutput( String namespaceUri, String suggestedFileName ) throws IOException;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ServiceLoaderUtil.java b/jaxb-api/src/main/java/javax/xml/bind/ServiceLoaderUtil.java
new file mode 100644
index 0000000..f56fcfb
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ServiceLoaderUtil.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+import java.util.ServiceLoader;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Shared ServiceLoader/FactoryFinder Utils shared among SAAJ, JAXB and JAXWS
+ * - this class must be duplicated to all those projects, but it's
+ * basically generic code and we want to have it everywhere same.
+ *
+ * @author Miroslav.Kos@oracle.com
+ */
+class ServiceLoaderUtil {
+
+    private static final String OSGI_SERVICE_LOADER_CLASS_NAME = "org.glassfish.hk2.osgiresourcelocator.ServiceLoader";
+    private static final String OSGI_SERVICE_LOADER_METHOD_NAME = "lookupProviderClasses";
+
+    static <P, T extends Exception> P firstByServiceLoader(Class<P> spiClass,
+                                                           Logger logger,
+                                                           ExceptionHandler<T> handler) throws T {
+        // service discovery
+        try {
+            ServiceLoader<P> serviceLoader = ServiceLoader.load(spiClass);
+
+            for (P impl : serviceLoader) {
+                logger.fine("ServiceProvider loading Facility used; returning object [" +
+                        impl.getClass().getName() + "]");
+
+                return impl;
+            }
+        } catch (Throwable t) {
+            throw handler.createException(t, "Error while searching for service [" + spiClass.getName() + "]");
+        }
+        return null;
+    }
+
+    static Object lookupUsingOSGiServiceLoader(String factoryId, Logger logger) {
+
+        try {
+            // Use reflection to avoid having any dependendcy on ServiceLoader class
+            Class serviceClass = Class.forName(factoryId);
+            Class target = Class.forName(OSGI_SERVICE_LOADER_CLASS_NAME);
+            Method m = target.getMethod(OSGI_SERVICE_LOADER_METHOD_NAME, Class.class);
+            Iterator iter = ((Iterable) m.invoke(null, serviceClass)).iterator();
+            if (iter.hasNext()) {
+                Object next = iter.next();
+                logger.fine("Found implementation using OSGi facility; returning object [" +
+                        next.getClass().getName() + "].");
+                return next;
+            } else {
+                return null;
+            }
+        } catch (IllegalAccessException |
+                InvocationTargetException |
+                ClassNotFoundException |
+                NoSuchMethodException ignored) {
+
+            logger.log(Level.FINE, "Unable to find from OSGi: [" + factoryId + "]", ignored);
+            return null;
+        }
+    }
+
+    static void checkPackageAccess(String className) {
+        // make sure that the current thread has an access to the package of the given name.
+        SecurityManager s = System.getSecurityManager();
+        if (s != null) {
+            int i = className.lastIndexOf('.');
+            if (i != -1) {
+                s.checkPackageAccess(className.substring(0, i));
+            }
+        }
+    }
+
+    static Class nullSafeLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+        if (classLoader == null) {
+            return Class.forName(className);
+        } else {
+            return classLoader.loadClass(className);
+        }
+    }
+
+    // Returns instance of required class. It checks package access (security)
+    // unless it is defaultClassname. It means if you are trying to instantiate
+    // default implementation (fallback), pass the class name to both first and second parameter.
+    static <T extends Exception> Object newInstance(String className,
+                                                    String defaultImplClassName,
+                                                    final ExceptionHandler<T> handler) throws T {
+        try {
+            return safeLoadClass(className, defaultImplClassName, contextClassLoader(handler)).newInstance();
+        } catch (ClassNotFoundException x) {
+            throw handler.createException(x, "Provider " + className + " not found");
+        } catch (Exception x) {
+            throw handler.createException(x, "Provider " + className + " could not be instantiated: " + x);
+        }
+    }
+
+    static Class safeLoadClass(String className,
+                               String defaultImplClassName,
+                               ClassLoader classLoader) throws ClassNotFoundException {
+
+        try {
+            checkPackageAccess(className);
+        } catch (SecurityException se) {
+            // anyone can access the platform default factory class without permission
+            if (defaultImplClassName != null && defaultImplClassName.equals(className)) {
+                return Class.forName(className);
+            }
+            // not platform default implementation ...
+            throw se;
+        }
+        return nullSafeLoadClass(className, classLoader);
+    }
+
+    static ClassLoader contextClassLoader(ExceptionHandler exceptionHandler) throws Exception {
+        try {
+            return Thread.currentThread().getContextClassLoader();
+        } catch (Exception x) {
+            throw exceptionHandler.createException(x, x.toString());
+        }
+    }
+
+    static abstract class ExceptionHandler<T extends Exception> {
+
+        public abstract T createException(Throwable throwable, String message);
+
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/TypeConstraintException.java b/jaxb-api/src/main/java/javax/xml/bind/TypeConstraintException.java
new file mode 100644
index 0000000..b351724
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/TypeConstraintException.java
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that a violation of a dynamically checked type 
+ * constraint was detected.
+ *
+ * <p>
+ * This exception can be thrown by the generated setter methods of the schema
+ * derived Java content classes.  However, since fail-fast validation is
+ * an optional feature for JAXB Providers to support, not all setter methods
+ * will throw this exception when a type constraint is violated.
+ * 
+ * <p>
+ * If this exception is throw while invoking a fail-fast setter, the value of
+ * the property is guaranteed to remain unchanged, as if the setter were never
+ * called.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see ValidationEvent
+ * @since 1.6, JAXB 1.0
+ */
+
+public class TypeConstraintException extends java.lang.RuntimeException {
+  
+    /** 
+     * Vendor specific error code
+     *
+     */
+    private String errorCode;
+
+    /** 
+     * Exception reference
+     *
+     */
+    private volatile Throwable linkedException;
+
+    static final long serialVersionUID = -3059799699420143848L;
+
+    /** 
+     * Construct a TypeConstraintException with the specified detail message.  The 
+     * errorCode and linkedException will default to null.
+     *
+     * @param message a description of the exception
+     */
+    public TypeConstraintException(String message) {
+        this( message, null, null );
+    }
+
+    /** 
+     * Construct a TypeConstraintException with the specified detail message and vendor 
+     * specific errorCode.  The linkedException will default to null.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     */
+    public TypeConstraintException(String message, String errorCode) {
+        this( message, errorCode, null );
+    }
+
+    /** 
+     * Construct a TypeConstraintException with a linkedException.  The detail message and
+     * vendor specific errorCode will default to null.
+     *
+     * @param exception the linked exception
+     */
+    public TypeConstraintException(Throwable exception) {
+        this( null, null, exception );
+    }
+    
+    /** 
+     * Construct a TypeConstraintException with the specified detail message and 
+     * linkedException.  The errorCode will default to null.
+     *
+     * @param message a description of the exception
+     * @param exception the linked exception
+     */
+    public TypeConstraintException(String message, Throwable exception) {
+        this( message, null, exception );
+    }
+    
+    /** 
+     * Construct a TypeConstraintException with the specified detail message,
+     * vendor specific errorCode, and linkedException.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     * @param exception the linked exception
+     */
+    public TypeConstraintException(String message, String errorCode, Throwable exception) {
+        super( message );
+        this.errorCode = errorCode;
+        this.linkedException = exception;
+    }
+    
+    /** 
+     * Get the vendor specific error code
+     *
+     * @return a string specifying the vendor specific error code
+     */
+    public String getErrorCode() {
+        return this.errorCode;
+    }
+
+    /**
+     * Get the linked exception 
+     *
+     * @return the linked Exception, null if none exists
+     */
+    public Throwable getLinkedException() {
+        return linkedException;
+    }
+
+    /**
+     * Add a linked Exception.
+     *
+     * @param exception the linked Exception (A null value is permitted and 
+     *                  indicates that the linked exception does not exist or
+     *                  is unknown).
+     */
+    public void setLinkedException( Throwable exception ) {
+        this.linkedException = exception;
+    }
+    
+    /**
+     * Returns a short description of this TypeConstraintException.
+     *
+     */
+    public String toString() {
+        return linkedException == null ? 
+            super.toString() :
+            super.toString() + "\n - with linked exception:\n[" +
+                                linkedException.toString()+ "]";
+    }
+ 
+    /**
+     * Prints this TypeConstraintException and its stack trace (including the stack trace
+     * of the linkedException if it is non-null) to the PrintStream.
+     *
+     * @param s PrintStream to use for output
+     */
+    public void printStackTrace( java.io.PrintStream s ) {
+        if( linkedException != null ) {
+          linkedException.printStackTrace(s);
+          s.println("--------------- linked to ------------------");
+        }
+
+        super.printStackTrace(s);
+    }
+ 
+    /**
+     * Prints this TypeConstraintException and its stack trace (including the stack trace
+     * of the linkedException if it is non-null) to {@code System.err}.
+     *
+     */
+    public void printStackTrace() {
+        printStackTrace(System.err);
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java b/jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java
new file mode 100644
index 0000000..c9758e2
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * an unmarshal operation that prevents the JAXB Provider from completing
+ * the operation.
+ * 
+ * <p>
+ * The {@code ValidationEventHandler} can cause this exception to be thrown
+ * during the unmarshal operations.  See 
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBException
+ * @see Unmarshaller
+ * @see ValidationEventHandler
+ * @since 1.6, JAXB 1.0
+ */
+public class UnmarshalException extends JAXBException {
+
+    /** 
+     * Construct an UnmarshalException with the specified detail message.  The 
+     * errorCode and linkedException will default to null.
+     *
+     * @param message a description of the exception
+     */
+    public UnmarshalException( String message ) {
+        this( message, null, null );
+    }
+
+    /** 
+     * Construct an UnmarshalException with the specified detail message and vendor 
+     * specific errorCode.  The linkedException will default to null.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     */
+    public UnmarshalException( String message, String errorCode ) {
+        this( message, errorCode, null );
+    }
+
+    /** 
+     * Construct an UnmarshalException with a linkedException.  The detail message and
+     * vendor specific errorCode will default to null.
+     *
+     * @param exception the linked exception
+     */
+    public UnmarshalException( Throwable exception ) {
+        this( null, null, exception );
+    }
+    
+    /** 
+     * Construct an UnmarshalException with the specified detail message and 
+     * linkedException.  The errorCode will default to null.
+     *
+     * @param message a description of the exception
+     * @param exception the linked exception
+     */
+    public UnmarshalException( String message, Throwable exception ) {
+        this( message, null, exception );
+    }
+    
+    /** 
+     * Construct an UnmarshalException with the specified detail message, vendor 
+     * specific errorCode, and linkedException.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     * @param exception the linked exception
+     */
+    public UnmarshalException( String message, String errorCode, Throwable exception ) {
+        super( message, errorCode, exception );
+    }
+
+}
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java b/jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java
new file mode 100644
index 0000000..5823a30
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java
@@ -0,0 +1,1123 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.validation.Schema;
+import java.io.Reader;
+
+/**
+ * The {@code Unmarshaller} class governs the process of deserializing XML
+ * data into newly created Java content trees, optionally validating the XML 
+ * data as it is unmarshalled.  It provides an overloading of unmarshal methods
+ * for many different input kinds.
+ *    
+ * <p>
+ * Unmarshalling from a File:
+ * <blockquote>
+ *    <pre>
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ *       Object o = u.unmarshal( new File( "nosferatu.xml" ) );
+ *    </pre>
+ * </blockquote>
+ *
+ *  
+ * <p>
+ * Unmarshalling from an InputStream:
+ * <blockquote>
+ *    <pre>
+ *       InputStream is = new FileInputStream( "nosferatu.xml" );
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ *       Object o = u.unmarshal( is );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a URL:
+ * <blockquote>
+ *    <pre>
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ *       URL url = new URL( "http://beaker.east/nosferatu.xml" );
+ *       Object o = u.unmarshal( url );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StringBuffer using a 
+ * {@code javax.xml.transform.stream.StreamSource}:
+ * <blockquote>
+ *    <pre>{@code
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ *       StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
+ *       Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );
+ *    }</pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a {@code org.w3c.dom.Node}:
+ * <blockquote>
+ *    <pre>
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ * 
+ *       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ *       dbf.setNamespaceAware(true);
+ *       DocumentBuilder db = dbf.newDocumentBuilder();
+ *       Document doc = db.parse(new File( "nosferatu.xml"));
+
+ *       Object o = u.unmarshal( doc );
+ *    </pre>
+ * </blockquote>
+ * 
+ * <p>
+ * Unmarshalling from a {@code javax.xml.transform.sax.SAXSource} using a
+ * client specified validating SAX2.0 parser:
+ * <blockquote>
+ *    <pre>
+ *       // configure a validating SAX2.0 parser (Xerces2)
+ *       static final String JAXP_SCHEMA_LANGUAGE =
+ *           "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ *       static final String JAXP_SCHEMA_LOCATION =
+ *           "http://java.sun.com/xml/jaxp/properties/schemaSource";
+ *       static final String W3C_XML_SCHEMA =
+ *           "http://www.w3.org/2001/XMLSchema";
+ *
+ *       System.setProperty( "javax.xml.parsers.SAXParserFactory",
+ *                           "org.apache.xerces.jaxp.SAXParserFactoryImpl" );
+ *
+ *       SAXParserFactory spf = SAXParserFactory.newInstance();
+ *       spf.setNamespaceAware(true);
+ *       spf.setValidating(true);
+ *       SAXParser saxParser = spf.newSAXParser();
+ *       
+ *       try {
+ *           saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
+ *           saxParser.setProperty(JAXP_SCHEMA_LOCATION, "http://....");
+ *       } catch (SAXNotRecognizedException x) {
+ *           // exception handling omitted
+ *       }
+ *
+ *       XMLReader xmlReader = saxParser.getXMLReader();
+ *       SAXSource source = 
+ *           new SAXSource( xmlReader, new InputSource( "http://..." ) );
+ *
+ *       // Setup JAXB to unmarshal
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ *       ValidationEventCollector vec = new ValidationEventCollector();
+ *       u.setEventHandler( vec );
+ *       
+ *       // turn off the JAXB provider's default validation mechanism to 
+ *       // avoid duplicate validation
+ *       u.setValidating( false )
+ *
+ *       // unmarshal
+ *       Object o = u.unmarshal( source );
+ *
+ *       // check for events
+ *       if( vec.hasEvents() ) {
+ *          // iterate over events
+ *       }
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StAX XMLStreamReader:
+ * <blockquote>
+ *    <pre>
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ * 
+ *       javax.xml.stream.XMLStreamReader xmlStreamReader = 
+ *           javax.xml.stream.XMLInputFactory().newInstance().createXMLStreamReader( ... );
+ * 
+ *       Object o = u.unmarshal( xmlStreamReader );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StAX XMLEventReader:
+ * <blockquote>
+ *    <pre>
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ * 
+ *       javax.xml.stream.XMLEventReader xmlEventReader = 
+ *           javax.xml.stream.XMLInputFactory().newInstance().createXMLEventReader( ... );
+ * 
+ *       Object o = u.unmarshal( xmlEventReader );
+ *    </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalEx"></a>
+ * <b>Unmarshalling XML Data</b><br>
+ * <blockquote>
+ * Unmarshalling can deserialize XML data that represents either an entire XML document 
+ * or a subtree of an XML document. Typically, it is sufficient to use the
+ * unmarshalling methods described by  
+ * <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal root element that is declared globally</a>.
+ * These unmarshal methods utilize {@link JAXBContext}'s mapping of global XML element
+ * declarations and type definitions to JAXB mapped classes to initiate the 
+ * unmarshalling of the root element of  XML data.  When the {@link JAXBContext}'s 
+ * mappings are not sufficient to unmarshal the root element of XML data, 
+ * the application can assist the unmarshalling process by using the 
+ * <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalByDeclaredType">unmarshal by declaredType methods</a>.
+ * These methods are useful for unmarshalling XML data where
+ * the root element corresponds to a local element declaration in the schema.
+ * </blockquote>
+ * 
+ * <blockquote>
+ * An unmarshal method never returns null. If the unmarshal process is unable to unmarshal
+ * the root of XML content to a JAXB mapped object, a fatal error is reported that
+ * terminates processing by throwing JAXBException.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalGlobal"></a>
+ * <b>Unmarshal a root element that is globally declared</b><br>
+ * <blockquote>
+ * The unmarshal methods that do not have an {@code declaredType} parameter use
+ * {@link JAXBContext} to unmarshal the root element of an XML data. The {@link JAXBContext} 
+ * instance is the one that was used to create this {@code Unmarshaller}. The {@link JAXBContext}
+ * instance maintains a mapping of globally declared XML element and type definition names to 
+ * JAXB mapped classes. The unmarshal method checks if {@link JAXBContext} has a mapping
+ * from the root element's XML name and/or {@code @xsi:type} to a JAXB mapped class.  If it does, it umarshalls the
+ * XML data using the appropriate JAXB mapped class. Note that when the root element name is unknown and the root
+ * element has an {@code @xsi:type}, the XML data is unmarshalled
+ * using that JAXB mapped class as the value of a {@link JAXBElement}.
+ * When the {@link JAXBContext} object does not have a mapping for the root element's name
+ * nor its {@code @xsi:type}, if it exists,
+ * then the unmarshal operation will abort immediately by throwing a {@link UnmarshalException 
+ * UnmarshalException}. This exception scenario can be worked around by using the unmarshal by 
+ * declaredType methods described in the next subsection.
+ * </blockquote>
+ * 
+ * <p>
+ * <a name="unmarshalByDeclaredType"></a>
+ * <b>Unmarshal by Declared Type</b><br>
+ * <blockquote>
+ * The unmarshal methods with a {@code declaredType} parameter enable an
+ * application to deserialize a root element of XML data, even when
+ * there is no mapping in {@link JAXBContext} of the root element's XML name.
+ * The unmarshaller unmarshals the root element using the application provided
+ * mapping specified as the {@code declaredType} parameter.
+ * Note that even when the root element's element name is mapped by {@link JAXBContext}, 
+ * the {@code declaredType} parameter overrides that mapping for
+ * deserializing the root element when using these unmarshal methods. 
+ * Additionally, when the root element of XML data has an {@code xsi:type} attribute and
+ * that attribute's value references a type definition that is mapped 
+ * to a JAXB mapped class by {@link JAXBContext}, that the root 
+ * element's {@code xsi:type} attribute takes
+ * precedence over the unmarshal methods {@code declaredType} parameter.
+ * These methods always return a {@code JAXBElement<declaredType>}
+ * instance. The table below shows how the properties of the returned JAXBElement 
+ * instance are set.
+ *
+ * <a name="unmarshalDeclaredTypeReturn"></a>
+ *   <table class="striped">
+ *   <caption>Unmarshal By Declared Type returned JAXBElement</caption>
+ *   <thead>
+ *     <tr>
+ *       <th scope="col">JAXBElement Property</th>
+ *       <th scope="col">Value</th>
+ *       </tr>
+ *     <tr>
+ *       <th scope="col">name</th>
+ *       <th scope="col">{@code xml element name}</th>
+ *     </tr>
+ *   </thead>
+ *   <tbody>
+ *     <tr>
+ *       <th scope="row">value</th>
+ *       <td>{@code instanceof declaredType}</td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row">declaredType</th>
+ *       <td>unmarshal method {@code declaredType} parameter</td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row">scope</th>
+ *       <td>{@code null} <i>(actual scope is unknown)</i></td>
+ *     </tr>
+ *   </tbody>
+ *  </table>
+ * </blockquote>
+ *
+ * <p>
+ * The following is an example of 
+ * <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalByDeclaredType">unmarshal by declaredType method</a>.
+ * <p>
+ * Unmarshal by declaredType from a {@code org.w3c.dom.Node}:
+ * <blockquote>
+ *    <pre>{@code 
+ *       Schema fragment for example
+ *       <xs:schema>
+ *          <xs:complexType name="FooType">...<\xs:complexType>
+ *          <!-- global element declaration "PurchaseOrder" -->
+ *          <xs:element name="PurchaseOrder">
+ *              <xs:complexType>
+ *                 <xs:sequence>
+ *                    <!-- local element declaration "foo" -->
+ *                    <xs:element name="foo" type="FooType"/>
+ *                    ...
+ *                 </xs:sequence>
+ *              </xs:complexType>
+ *          </xs:element>
+ *       </xs:schema>
+ *
+ *       JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *       Unmarshaller u = jc.createUnmarshaller();
+ * 
+ *       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ *       dbf.setNamespaceAware(true);
+ *       DocumentBuilder db = dbf.newDocumentBuilder();
+ *       Document doc = db.parse(new File( "nosferatu.xml"));
+ *       Element  fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a 
+ *                                  // local element declaration in schema.
+ * 
+ *       // FooType is the JAXB mapping of the type of local element declaration foo.
+ *       JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+ *    }</pre>
+ * </blockquote>
+ * 
+ * <p>
+ * <b>Support for SAX2.0 Compliant Parsers</b><br>
+ * <blockquote>
+ * A client application has the ability to select the SAX2.0 compliant parser
+ * of their choice.  If a SAX parser is not selected, then the JAXB Provider's
+ * default parser will be used.  Even though the JAXB Provider's default parser
+ * is not required to be SAX2.0 compliant, all providers are required to allow
+ * a client application to specify their own SAX2.0 parser.  Some providers may
+ * require the client application to specify the SAX2.0 parser at schema compile
+ * time. See {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)} 
+ * for more detail.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * A client application can enable or disable JAXP 1.3 validation
+ * mechanism via the {@code setSchema(javax.xml.validation.Schema)} API.
+ * Sophisticated clients can specify their own validating SAX 2.0 compliant 
+ * parser and bypass the JAXP 1.3 validation mechanism using the 
+ * {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)}  API.
+ * 
+ * <p>
+ * Since unmarshalling invalid XML content is defined in JAXB 2.0, 
+ * the Unmarshaller default validation event handler was made more lenient
+ * than in JAXB 1.0.  When schema-derived code generated
+ * by JAXB 1.0 binding compiler is registered with {@link JAXBContext}, 
+ * the default unmarshal validation handler is 
+ * {@link javax.xml.bind.helpers.DefaultValidationEventHandler} and it
+ * terminates the marshal  operation after encountering either a fatal error or an error. 
+ * For a JAXB 2.0 client application, there is no explicitly defined default
+ * validation handler and the default event handling only 
+ * terminates the unmarshal operation after encountering a fatal error.
+ * 
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * There currently are not any properties required to be supported by all 
+ * JAXB Providers on Unmarshaller.  However, some providers may support 
+ * their own set of provider specific properties.
+ * </blockquote>
+ * 
+ * <p>
+ * <a name="unmarshalEventCallback"></a>
+ * <b>Unmarshal Event Callbacks</b><br>
+ * <blockquote>
+ * The {@link Unmarshaller} provides two styles of callback mechanisms
+ * that allow application specific processing during key points in the
+ * unmarshalling process.  In 'class defined' event callbacks, application
+ * specific code placed in JAXB mapped classes is triggered during
+ * unmarshalling.  'External listeners' allow for centralized processing
+ * of unmarshal events in one callback method rather than by type event callbacks.
+ * <p>
+ * 'Class defined' event callback methods allow any JAXB mapped class to specify 
+ * its own specific callback methods by defining methods with the following method signature:
+ * <blockquote>
+ * <pre>
+ *   // This method is called immediately after the object is created and before the unmarshalling of this 
+ *   // object begins. The callback provides an opportunity to initialize JavaBean properties prior to unmarshalling.
+ *   void beforeUnmarshal(Unmarshaller, Object parent);
+ * 
+ *   //This method is called after all the properties (except IDREF) are unmarshalled for this object, 
+ *   //but before this object is set to the parent object.
+ *   void afterUnmarshal(Unmarshaller, Object parent);
+ * </pre>
+ * </blockquote>
+ * The class defined callback methods should be used when the callback method requires
+ * access to non-public methods and/or fields of the class. 
+ * <p>
+ * The external listener callback mechanism enables the registration of a {@link Listener} 
+ * instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events, 
+ * allowing for more centralized processing than per class defined callback methods.  The external listener 
+ * receives events when unmarshalling process is marshalling to a JAXB element or to JAXB mapped class.
+ * <p>
+ * The 'class defined' and external listener event callback methods are independent of each other,
+ * both can be called for one event.  The invocation ordering when both listener callback methods exist is
+ * defined in {@link Listener#beforeUnmarshal(Object, Object)} and {@link Listener#afterUnmarshal(Object, Object)}. 
+* <p>
+ * An event callback method throwing an exception terminates the current unmarshal process.
+ * 
+ * </blockquote>
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Validator
+ * @since 1.6, JAXB 1.0
+ */
+public interface Unmarshaller {
+    
+    /**
+     * Unmarshal XML data from the specified file and return the resulting
+     * content tree.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     * 
+     * @param f the file to unmarshal XML data from
+     * @return the newly created root object of the java content tree 
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the file parameter is null
+     */
+    public Object unmarshal( java.io.File f ) throws JAXBException;
+    
+    /**
+     * Unmarshal XML data from the specified InputStream and return the 
+     * resulting content tree.  Validation event location information may
+     * be incomplete when using this form of the unmarshal API.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     * 
+     * @param is the InputStream to unmarshal XML data from
+     * @return the newly created root object of the java content tree 
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the InputStream parameter is null
+     */
+    public Object unmarshal( java.io.InputStream is ) throws JAXBException;
+
+    /**
+     * Unmarshal XML data from the specified Reader and return the
+     * resulting content tree.  Validation event location information may
+     * be incomplete when using this form of the unmarshal API,
+     * because a Reader does not provide the system ID.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     * 
+     * @param reader the Reader to unmarshal XML data from
+     * @return the newly created root object of the java content tree
+     *
+     * @throws JAXBException
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the InputStream parameter is null
+     * @since 1.6, JAXB 2.0
+     */
+    public Object unmarshal( Reader reader ) throws JAXBException;
+
+    /**
+     * Unmarshal XML data from the specified URL and return the resulting
+     * content tree.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     *
+     * @param url the url to unmarshal XML data from
+     * @return the newly created root object of the java content tree 
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the URL parameter is null
+     */
+    public Object unmarshal( java.net.URL url ) throws JAXBException;
+    
+    /**
+     * Unmarshal XML data from the specified SAX InputSource and return the
+     * resulting content tree.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     *
+     * @param source the input source to unmarshal XML data from
+     * @return the newly created root object of the java content tree 
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the InputSource parameter is null
+     */
+    public Object unmarshal( org.xml.sax.InputSource source ) throws JAXBException;
+    
+    /**
+     * Unmarshal global XML data from the specified DOM tree and return the resulting
+     * content tree.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     *
+     * @param node
+     *      the document/element to unmarshal XML data from.
+     *      The caller must support at least Document and Element.
+     * @return the newly created root object of the java content tree 
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the Node parameter is null
+     * @see #unmarshal(org.w3c.dom.Node, Class)
+     */
+    public Object unmarshal( org.w3c.dom.Node node ) throws JAXBException;
+
+    /**
+     * Unmarshal XML data by JAXB mapped {@code declaredType}
+     * and return the resulting content tree.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+     *
+     * @param node
+     *      the document/element to unmarshal XML data from.
+     *      The caller must support at least Document and Element.
+     * @param declaredType
+     *      appropriate JAXB mapped class to hold {@code node}'s XML data.
+     * 
+     * @return <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalDeclaredTypeReturn">JAXB Element</a> representation of {@code node}
+     * 
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If any parameter is null
+     * @since 1.6, JAXB 2.0
+     */
+    public <T> JAXBElement<T> unmarshal( org.w3c.dom.Node node, Class<T> declaredType ) throws JAXBException;
+    
+    /**
+     * Unmarshal XML data from the specified XML Source and return the 
+     * resulting content tree.  
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     *
+     * <p>
+     * <a name="saxParserPlugable"></a>
+     * <b>SAX 2.0 Parser Pluggability</b>
+     * <p>
+     * A client application can choose not to use the default parser mechanism
+     * supplied with their JAXB provider.  Any SAX 2.0 compliant parser can be
+     * substituted for the JAXB provider's default mechanism.  To do so, the
+     * client application must properly configure a {@code SAXSource} containing
+     * an {@code XMLReader} implemented by the SAX 2.0 parser provider.  If the
+     * {@code XMLReader} has an {@code org.xml.sax.ErrorHandler} registered
+     * on it, it will be replaced by the JAXB Provider so that validation errors
+     * can be reported via the {@code ValidationEventHandler} mechanism of
+     * JAXB.  If the {@code SAXSource} does not contain an {@code XMLReader},
+     * then the JAXB provider's default parser mechanism will be used.
+     * <p>
+     * This parser replacement mechanism can also be used to replace the JAXB
+     * provider's unmarshal-time validation engine.  The client application 
+     * must properly configure their SAX 2.0 compliant parser to perform
+     * validation (as shown in the example above).  Any {@code SAXParserExceptions}
+     * encountered by the parser during the unmarshal operation will be
+     * processed by the JAXB provider and converted into JAXB 
+     * {@code ValidationEvent} objects which will be reported back to the
+     * client via the {@code ValidationEventHandler} registered with the
+     * {@code Unmarshaller}.  <i>Note:</i> specifying a substitute validating
+     * SAX 2.0 parser for unmarshalling does not necessarily replace the 
+     * validation engine used by the JAXB provider for performing on-demand 
+     * validation.
+     * <p>
+     * The only way for a client application to specify an alternate parser
+     * mechanism to be used during unmarshal is via the 
+     * {@code unmarshal(SAXSource)} API.  All other forms of the unmarshal
+     * method (File, URL, Node, etc) will use the JAXB provider's default 
+     * parser and validator mechanisms.
+     *
+     * @param source the XML Source to unmarshal XML data from (providers are
+     *        only required to support SAXSource, DOMSource, and StreamSource)
+     * @return the newly created root object of the java content tree
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the Source parameter is null
+     * @see #unmarshal(javax.xml.transform.Source, Class)
+     */
+    public Object unmarshal( javax.xml.transform.Source source )
+        throws JAXBException;
+
+
+    /**
+     * Unmarshal XML data from the specified XML Source by {@code declaredType} and return the
+     * resulting content tree.  
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+     *
+     * <p>
+     * See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#saxParserPlugable">SAX 2.0 Parser Pluggability</a>
+     *
+     * @param source the XML Source to unmarshal XML data from (providers are
+     *        only required to support SAXSource, DOMSource, and StreamSource)
+     * @param declaredType 
+     *      appropriate JAXB mapped class to hold {@code source}'s xml root element
+     * @return Java content rooted by <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalDeclaredTypeReturn">JAXB Element</a>
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If any parameter is null
+     * @since 1.6, JAXB 2.0
+     */
+    public <T> JAXBElement<T> unmarshal( javax.xml.transform.Source source, Class<T> declaredType )
+        throws JAXBException;
+    
+    /**
+     * Unmarshal XML data from the specified pull parser and return the
+     * resulting content tree.
+     *
+     * <p>
+     * Implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root Element</a>.
+     * 
+     * <p>
+     * This method assumes that the parser is on a START_DOCUMENT or
+     * START_ELEMENT event.  Unmarshalling will be done from this 
+     * start event to the corresponding end event.  If this method 
+     * returns successfully, the {@code reader} will be pointing at
+     * the token right after the end event.
+     * 
+     * @param reader
+     *      The parser to be read.
+     * @return
+     *      the newly created root object of the java content tree.
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the {@code reader} parameter is null
+     * @throws IllegalStateException
+     *      If {@code reader} is not pointing to a START_DOCUMENT or
+     *      START_ELEMENT  event.
+     * @since 1.6, JAXB 2.0
+     * @see #unmarshal(javax.xml.stream.XMLStreamReader, Class)
+     */
+    public Object unmarshal( javax.xml.stream.XMLStreamReader reader )
+        throws JAXBException;
+    
+    /**
+     * Unmarshal root element to JAXB mapped {@code declaredType}
+     * and return the resulting content tree.
+     * 
+     * <p>
+     * This method implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalByDeclaredType">unmarshal by declaredType</a>.
+     * <p>
+     * This method assumes that the parser is on a START_DOCUMENT or
+     * START_ELEMENT event. Unmarshalling will be done from this 
+     * start event to the corresponding end event.  If this method 
+     * returns successfully, the {@code reader} will be pointing at 
+     * the token right after the end event.
+     *
+     * @param reader
+     *      The parser to be read. 
+     * @param declaredType
+     *      appropriate JAXB mapped class to hold {@code reader}'s START_ELEMENT XML data.
+     * 
+     * @return   content tree rooted by <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+     * 
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If any parameter is null
+     * @since 1.6, JAXB 2.0
+     */
+    public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLStreamReader reader, Class<T> declaredType ) throws JAXBException;
+
+    /**
+     * Unmarshal XML data from the specified pull parser and return the
+     * resulting content tree.
+     *
+     * <p>
+     * This method is an <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalGlobal">Unmarshal Global Root method</a>.
+     *
+     * <p>
+     * This method assumes that the parser is on a START_DOCUMENT or
+     * START_ELEMENT event.  Unmarshalling will be done from this 
+     * start event to the corresponding end event.  If this method 
+     * returns successfully, the {@code reader} will be pointing at 
+     * the token right after the end event. 
+     * 
+     * @param reader
+     *      The parser to be read.
+     * @return
+     *      the newly created root object of the java content tree.
+     *
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If the {@code reader} parameter is null
+     * @throws IllegalStateException
+     *      If {@code reader} is not pointing to a START_DOCUMENT or
+     *      START_ELEMENT event.
+     * @since 1.6, JAXB 2.0
+     * @see #unmarshal(javax.xml.stream.XMLEventReader, Class)
+     */
+    public Object unmarshal( javax.xml.stream.XMLEventReader reader )
+        throws JAXBException;
+    
+    /**
+     * Unmarshal root element to JAXB mapped {@code declaredType}
+     * and return the resulting content tree.
+     * 
+     * <p>
+     * This method implements <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalByDeclaredType">unmarshal by declaredType</a>.
+     *
+     * <p>
+     * This method assumes that the parser is on a START_DOCUMENT or
+     * START_ELEMENT event. Unmarshalling will be done from this 
+     * start event to the corresponding end event.  If this method 
+     * returns successfully, the {@code reader} will be pointing at 
+     * the token right after the end event.
+     *
+     * @param reader
+     *      The parser to be read. 
+     * @param declaredType
+     *      appropriate JAXB mapped class to hold {@code reader}'s START_ELEMENT XML data.
+     * 
+     * @return   content tree rooted by <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+     * 
+     * @throws JAXBException 
+     *     If any unexpected errors occur while unmarshalling
+     * @throws UnmarshalException
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Unmarshaller} is unable to perform the XML to Java
+     *     binding.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#unmarshalEx">Unmarshalling XML Data</a>
+     * @throws IllegalArgumentException
+     *      If any parameter is null
+     * @since 1.6, JAXB 2.0
+     */
+    public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLEventReader reader, Class<T> declaredType ) throws JAXBException;
+
+    /**
+     * Get an unmarshaller handler object that can be used as a component in
+     * an XML pipeline.
+     * 
+     * <p>
+     * The JAXB Provider can return the same handler object for multiple 
+     * invocations of this method. In other words, this method does not 
+     * necessarily create a new instance of {@code UnmarshallerHandler}. If the
+     * application needs to use more than one {@code UnmarshallerHandler}, it
+     * should create more than one {@code Unmarshaller}.
+     *
+     * @return the unmarshaller handler object
+     * @see UnmarshallerHandler
+     */
+    public UnmarshallerHandler getUnmarshallerHandler();
+    
+    /**
+     * Specifies whether or not the default validation mechanism of the
+     * {@code Unmarshaller} should validate during unmarshal operations.
+     * By default, the {@code Unmarshaller} does not validate.
+     * <p>
+     * This method may only be invoked before or after calling one of the
+     * unmarshal methods.
+     * <p>
+     * This method only controls the JAXB Provider's default unmarshal-time
+     * validation mechanism - it has no impact on clients that specify their 
+     * own validating SAX 2.0 compliant parser.  Clients that specify their
+     * own unmarshal-time validation mechanism may wish to turn off the JAXB
+     * Provider's default validation mechanism via this API to avoid "double
+     * validation".
+     * <p>
+     * This method is deprecated as of JAXB 2.0 - please use the new
+     * {@link #setSchema(javax.xml.validation.Schema)} API.
+     *
+     * @param validating true if the Unmarshaller should validate during 
+     *        unmarshal, false otherwise
+     * @throws JAXBException if an error occurred while enabling or disabling
+     *         validation at unmarshal time
+     * @throws UnsupportedOperationException could be thrown if this method is
+     *         invoked on an Unmarshaller created from a JAXBContext referencing
+     *         JAXB 2.0 mapped classes
+     * @deprecated since JAXB2.0, please see {@link #setSchema(javax.xml.validation.Schema)}
+     */
+    public void setValidating( boolean validating ) 
+        throws JAXBException;
+    
+    /**
+     * Indicates whether or not the {@code Unmarshaller} is configured to
+     * validate during unmarshal operations.
+     * <p>
+     * This API returns the state of the JAXB Provider's default unmarshal-time
+     * validation mechanism. 
+     * <p>
+     * This method is deprecated as of JAXB 2.0 - please use the new
+     * {@link #getSchema()} API.
+     *
+     * @return true if the Unmarshaller is configured to validate during 
+     *         unmarshal operations, false otherwise
+     * @throws JAXBException if an error occurs while retrieving the validating
+     *         flag
+     * @throws UnsupportedOperationException could be thrown if this method is
+     *         invoked on an Unmarshaller created from a JAXBContext referencing
+     *         JAXB 2.0 mapped classes
+     * @deprecated since JAXB2.0, please see {@link #getSchema()}
+     */
+    public boolean isValidating() 
+        throws JAXBException;
+    
+    /**
+     * Allow an application to register a {@code ValidationEventHandler}.
+     * <p>
+     * The {@code ValidationEventHandler} will be called by the JAXB Provider
+     * if any validation errors are encountered during calls to any of the 
+     * unmarshal methods.  If the client application does not register a 
+     * {@code ValidationEventHandler} before invoking the unmarshal methods,
+     * then {@code ValidationEvents} will be handled by the default event
+     * handler which will terminate the unmarshal operation after the first 
+     * error or fatal error is encountered.
+     * <p>
+     * Calling this method with a null parameter will cause the Unmarshaller
+     * to revert back to the default event handler.
+     *
+     * @param handler the validation event handler
+     * @throws JAXBException if an error was encountered while setting the
+     *         event handler
+     */
+    public void setEventHandler( ValidationEventHandler handler )
+        throws JAXBException;
+
+    /**
+     * Return the current event handler or the default event handler if one
+     * hasn't been set.
+     *
+     * @return the current ValidationEventHandler or the default event handler
+     *         if it hasn't been set
+     * @throws JAXBException if an error was encountered while getting the 
+     *         current event handler
+     */
+    public ValidationEventHandler getEventHandler()
+        throws JAXBException;
+
+    /**
+     * Set the particular property in the underlying implementation of 
+     * {@code Unmarshaller}.  This method can only be used to set one of
+     * the standard JAXB defined properties above or a provider specific
+     * property.  Attempting to set an undefined property will result in
+     * a PropertyException being thrown.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#supportedProps">
+     * Supported Properties</a>.
+     *
+     * @param name the name of the property to be set. This value can either
+     *              be specified using one of the constant fields or a user 
+     *              supplied string.
+     * @param value the value of the property to be set
+     *
+     * @throws PropertyException when there is an error processing the given
+     *                            property or value
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     */
+    public void setProperty( String name, Object value ) 
+        throws PropertyException;
+    
+    /**
+     * Get the particular property in the underlying implementation of 
+     * {@code Unmarshaller}.  This method can only be used to get one of
+     * the standard JAXB defined properties above or a provider specific
+     * property.  Attempting to get an undefined property will result in
+     * a PropertyException being thrown.  See <a href="{@docRoot}/javax/xml/bind/Unmarshaller.html#supportedProps">
+     * Supported Properties</a>.
+     *
+     * @param name the name of the property to retrieve
+     * @return the value of the requested property
+     *
+     * @throws PropertyException
+     *      when there is an error retrieving the given property or value
+     *      property name
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     */
+    public Object getProperty( String name ) throws PropertyException;
+
+    /**
+     * Specify the JAXP 1.3 {@link javax.xml.validation.Schema Schema}
+     * object that should be used to validate subsequent unmarshal operations
+     * against.  Passing null into this method will disable validation.
+     * <p>
+     * This method replaces the deprecated {@link #setValidating(boolean) setValidating(boolean)}
+     * API.
+     *
+     * <p>
+     * Initially this property is set to {@code null}.
+     *
+     * @param schema Schema object to validate unmarshal operations against or null to disable validation
+     * @throws UnsupportedOperationException could be thrown if this method is
+     *         invoked on an Unmarshaller created from a JAXBContext referencing
+     *         JAXB 1.0 mapped classes
+     * @since 1.6, JAXB 2.0
+     */
+    public void setSchema( javax.xml.validation.Schema schema );
+
+    /**
+     * Get the JAXP 1.3 {@link javax.xml.validation.Schema Schema} object
+     * being used to perform unmarshal-time validation.  If there is no
+     * Schema set on the unmarshaller, then this method will return null
+     * indicating that unmarshal-time validation will not be performed.
+     * <p>
+     * This method provides replacement functionality for the deprecated
+     * {@link #isValidating()} API as well as access to the Schema object.
+     * To determine if the Unmarshaller has validation enabled, simply
+     * test the return type for null:
+     * <pre>{@code
+     *   boolean isValidating = u.getSchema()!=null;
+     * }</pre>
+     * 
+     * @return the Schema object being used to perform unmarshal-time
+     *      validation or null if not present
+     * @throws UnsupportedOperationException could be thrown if this method is
+     *         invoked on an Unmarshaller created from a JAXBContext referencing
+     *         JAXB 1.0 mapped classes
+     * @since 1.6, JAXB 2.0
+     */
+    public javax.xml.validation.Schema getSchema();
+
+    /**
+     * Associates a configured instance of {@link XmlAdapter} with this unmarshaller.
+     *
+     * <p>
+     * This is a convenience method that invokes {@code setAdapter(adapter.getClass(),adapter);}.
+     *
+     * @see #setAdapter(Class,XmlAdapter)
+     * @throws IllegalArgumentException
+     *      if the adapter parameter is null.
+     * @throws UnsupportedOperationException
+     *      if invoked agains a JAXB 1.0 implementation.
+     * @since 1.6, JAXB 2.0
+     */
+    public void setAdapter( XmlAdapter adapter );
+
+    /**
+     * Associates a configured instance of {@link XmlAdapter} with this unmarshaller.
+     *
+     * <p>
+     * Every unmarshaller internally maintains a
+     * {@link java.util.Map}&lt;{@link Class},{@link XmlAdapter}&gt;,
+     * which it uses for unmarshalling classes whose fields/methods are annotated
+     * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
+     *
+     * <p>
+     * This method allows applications to use a configured instance of {@link XmlAdapter}.
+     * When an instance of an adapter is not given, an unmarshaller will create
+     * one by invoking its default constructor.
+     *
+     * @param type
+     *      The type of the adapter. The specified instance will be used when
+     *      {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
+     *      refers to this type.
+     * @param adapter
+     *      The instance of the adapter to be used. If null, it will un-register
+     *      the current adapter set for this type.
+     * @throws IllegalArgumentException
+     *      if the type parameter is null.
+     * @throws UnsupportedOperationException
+     *      if invoked agains a JAXB 1.0 implementation.
+     * @since 1.6, JAXB 2.0
+     */
+    public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
+
+    /**
+     * Gets the adapter associated with the specified type.
+     *
+     * This is the reverse operation of the {@link #setAdapter} method.
+     *
+     * @throws IllegalArgumentException
+     *      if the type parameter is null.
+     * @throws UnsupportedOperationException
+     *      if invoked agains a JAXB 1.0 implementation.
+     * @since 1.6, JAXB 2.0
+     */
+    public <A extends XmlAdapter> A getAdapter( Class<A> type );
+
+    /**
+     * <p>Associate a context that resolves cid's, content-id URIs, to
+     * binary data passed as attachments.</p>
+     * <p>Unmarshal time validation, enabled via {@link #setSchema(Schema)},
+     * must be supported even when unmarshaller is performing XOP processing.
+     * </p>
+     *
+     * @throws IllegalStateException if attempt to concurrently call this
+     *                               method during a unmarshal operation.
+     */
+    void setAttachmentUnmarshaller(AttachmentUnmarshaller au);
+
+    AttachmentUnmarshaller getAttachmentUnmarshaller();
+
+    /**
+     * <p>
+     * Register an instance of an implementation of this class with {@link Unmarshaller} to externally listen
+     * for unmarshal events.
+     * </p>
+     * <p>
+     * This class enables pre and post processing of an instance of a JAXB mapped class
+     * as XML data is unmarshalled into it. The event callbacks are called when unmarshalling
+     * XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition.
+     * The event callbacks are not called when unmarshalling to an instance of a
+     * Java datatype that represents a simple type definition.
+     * </p>
+     * <p>
+     * External listener is one of two different mechanisms for defining unmarshal event callbacks.
+     * See <a href="Unmarshaller.html#unmarshalEventCallback">Unmarshal Event Callbacks</a> for an overview.
+     * </p>
+     * (@link #setListener(Listener)}
+     * (@link #getListener()}
+     *
+     * @since 1.6, JAXB 2.0
+     */
+    public static abstract class Listener {
+        /**
+         * <p>
+         * Callback method invoked before unmarshalling into {@code target}.
+         * </p>
+         * <p>
+         * This method is invoked immediately after {@code target} was created and
+         * before the unmarshalling of this object begins. Note that
+         * if the class of {@code target} defines its own {@code beforeUnmarshal} method,
+         * the class specific callback method is invoked before this method is invoked.
+         *
+         * @param target non-null instance of JAXB mapped class prior to unmarshalling into it.
+         * @param parent instance of JAXB mapped class that will eventually reference {@code target}.
+         *               {@code null} when {@code target} is root element.
+         */
+        public void beforeUnmarshal(Object target, Object parent) {
+        }
+
+        /**
+         * <p>
+         * Callback method invoked after unmarshalling XML data into {@code target}.
+         * </p>
+         * <p>
+         * This method is invoked after all the properties (except IDREF)
+         * are unmarshalled into {@code target},
+         * but before {@code target} is set into its {@code parent} object.
+         * Note that if the class of {@code target} defines its own {@code afterUnmarshal} method,
+         * the class specific callback method is invoked before this method is invoked.
+         *
+         * @param target non-null instance of JAXB mapped class prior to unmarshalling into it.
+         * @param parent instance of JAXB mapped class that will reference {@code target}.
+         *               {@code null} when {@code target} is root element.
+         */
+        public void afterUnmarshal(Object target, Object parent) {
+        }
+    }
+
+    /**
+     * <p>
+     * Register unmarshal event callback {@link Listener} with this {@link Unmarshaller}.
+     * 
+     * <p>
+     * There is only one Listener per Unmarshaller. Setting a Listener replaces the previous set Listener.
+     * One can unregister current Listener by setting listener to {@code null}.
+     * 
+     * @param listener  provides unmarshal event callbacks for this {@link Unmarshaller}
+     * @since 1.6, JAXB 2.0
+     */
+    public void     setListener(Listener listener);
+
+    /**
+     * <p>Return {@link Listener} registered with this {@link Unmarshaller}.
+     *
+     * @return registered {@link Listener} or {@code null}
+     *         if no Listener is registered with this Unmarshaller.
+     * @since 1.6, JAXB 2.0
+     */
+    public Listener getListener();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java b/jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java
new file mode 100644
index 0000000..85c15ba
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import org.xml.sax.ContentHandler;
+
+/**
+ * Unmarshaller implemented as SAX ContentHandler.
+ * 
+ * <p>
+ * Applications can use this interface to use their JAXB provider as a component 
+ * in an XML pipeline.  For example:
+ * 
+ * <pre>
+ *       JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );
+ *
+ *       Unmarshaller unmarshaller = context.createUnmarshaller();
+ * 
+ *       UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
+ *
+ *       SAXParserFactory spf = SAXParserFactory.newInstance();
+ *       spf.setNamespaceAware( true );
+ * 
+ *       XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+ *       xmlReader.setContentHandler( unmarshallerHandler );
+ *       xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );
+ *
+ *       MyObject myObject= (MyObject)unmarshallerHandler.getResult();                          
+ * </pre>
+ * 
+ * <p>
+ * This interface is reusable: even if the user fails to unmarshal
+ * an object, s/he can still start a new round of unmarshalling.
+ * 
+ * @author <ul><li>Kohsuke KAWAGUCHI, Sun Microsystems, Inc.</li></ul>
+ * @see Unmarshaller#getUnmarshallerHandler()
+ * @since 1.6, JAXB 1.0
+ */
+public interface UnmarshallerHandler extends ContentHandler
+{
+    /**
+     * Obtains the unmarshalled result.
+     * 
+     * This method can be called only after this handler
+     * receives the endDocument SAX event.
+     * 
+     * @exception IllegalStateException
+     *      if this method is called before this handler
+     *      receives the endDocument event.
+     * 
+     * @exception JAXBException
+     *      if there is any unmarshalling error.
+     *      Note that the implementation is allowed to throw SAXException
+     *      during the parsing when it finds an error.
+     * 
+     * @return
+     *      always return a non-null valid object which was unmarshalled.
+     */
+    Object getResult() throws JAXBException, IllegalStateException;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java b/jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java
new file mode 100644
index 0000000..aadb64e
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while validating the    
+ * incoming XML data during an unmarshal operation, while performing 
+ * on-demand validation of the Java content tree, or while marshalling the
+ * Java content tree back to XML data.
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since 1.6, JAXB 1.0
+ */
+public interface ValidationEvent {
+    
+    /** 
+     * Conditions that are not errors or fatal errors as defined by the 
+     * XML 1.0 recommendation 
+     */
+    public static final int WARNING     = 0;
+    
+    /**
+     * Conditions that correspond to the definition of "error" in section 
+     * 1.2 of the W3C XML 1.0 Recommendation
+     */
+    public static final int ERROR       = 1;
+    
+    /**
+     * Conditions that correspond to the definition of "fatal error" in section 
+     * 1.2 of the W3C XML 1.0 Recommendation
+     */
+    public static final int FATAL_ERROR = 2;
+
+    /**
+     * Retrieve the severity code for this warning/error. 
+     *
+     * <p>
+     * Must be one of {@code ValidationEvent.WARNING},
+     * {@code ValidationEvent.ERROR}, or {@code ValidationEvent.FATAL_ERROR}.
+     *
+     * @return the severity code for this warning/error
+     */
+    public int getSeverity();
+    
+    /**
+     * Retrieve the text message for this warning/error.
+     *
+     * @return the text message for this warning/error or null if one wasn't set
+     */
+    public String getMessage();
+    
+    /**
+     * Retrieve the linked exception for this warning/error.
+     *
+     * @return the linked exception for this warning/error or null if one
+     *         wasn't set
+     */
+    public Throwable getLinkedException();
+    
+    /**
+     * Retrieve the locator for this warning/error.
+     *
+     * @return the locator that indicates where the warning/error occurred
+     */
+    public ValidationEventLocator getLocator();
+    
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java b/jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java
new file mode 100644
index 0000000..63900a4
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * A basic event handler interface for validation errors.
+ *
+ * <p>
+ * If an application needs to implement customized event handling, it must
+ * implement this interface and then register it with either the 
+ * {@link Unmarshaller#setEventHandler(ValidationEventHandler) Unmarshaller}, 
+ * the {@link Validator#setEventHandler(ValidationEventHandler) Validator}, or 
+ * the {@link Marshaller#setEventHandler(ValidationEventHandler) Marshaller}.  
+ * The JAXB Provider will then report validation errors and warnings encountered
+ * during the unmarshal, marshal, and validate operations to these event 
+ * handlers.
+ *
+ * <p>
+ * If the {@code handleEvent} method throws an unchecked runtime exception,
+ * the JAXB Provider must treat that as if the method returned false, effectively
+ * terminating whatever operation was in progress at the time (unmarshal, 
+ * validate, or marshal).
+ * 
+ * <p>
+ * Modifying the Java content tree within your event handler is undefined
+ * by the specification and may result in unexpected behaviour.
+ *
+ * <p>
+ * Failing to return false from the {@code handleEvent} method after
+ * encountering a fatal error is undefined by the specification and may result 
+ * in unexpected behavior.
+ *
+ * <p>
+ * <b>Default Event Handler</b>
+ * <blockquote>
+ *    See: <a href="Validator.html#defaulthandler">Validator javadocs</a>
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li>
+ *             <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ *             <li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @see Unmarshaller
+ * @see Validator
+ * @see Marshaller
+ * @see ValidationEvent
+ * @see javax.xml.bind.util.ValidationEventCollector
+ * @since 1.6, JAXB 1.0
+ */
+public interface ValidationEventHandler {
+    /**
+     * Receive notification of a validation warning or error.  
+     * 
+     * The ValidationEvent will have a 
+     * {@link ValidationEventLocator ValidationEventLocator} embedded in it that 
+     * indicates where the error or warning occurred.
+     *
+     * <p>
+     * If an unchecked runtime exception is thrown from this method, the JAXB
+     * provider will treat it as if the method returned false and interrupt
+     * the current unmarshal, validate, or marshal operation.
+     * 
+     * @param event the encapsulated validation event information.  It is a 
+     * provider error if this parameter is null.
+     * @return true if the JAXB Provider should attempt to continue the current
+     *         unmarshal, validate, or marshal operation after handling this 
+     *         warning/error, false if the provider should terminate the current 
+     *         operation with the appropriate {@code UnmarshalException},
+     *         {@code ValidationException}, or {@code MarshalException}.
+     * @throws IllegalArgumentException if the event object is null.
+     */
+    public boolean handleEvent( ValidationEvent event );
+    
+}
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java b/jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java
new file mode 100644
index 0000000..ff46977
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * Encapsulate the location of a ValidationEvent.
+ *
+ * <p>
+ * The {@code ValidationEventLocator} indicates where the {@code ValidationEvent}
+ * occurred.  Different fields will be set depending on the type of
+ * validation that was being performed when the error or warning was detected.
+ * For example, on-demand validation would produce locators that contained 
+ * references to objects in the Java content tree while unmarshal-time 
+ * validation would produce locators containing information appropriate to the 
+ * source of the XML data (file, url, Node, etc).
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li>
+ *             <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ *             <li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @see Validator
+ * @see ValidationEvent
+ * @since 1.6, JAXB 1.0
+ */
+public interface ValidationEventLocator {
+
+    /**
+     * Return the name of the XML source as a URL if available
+     *
+     * @return the name of the XML source as a URL or null if unavailable
+     */
+    public java.net.URL getURL();
+    
+    /**
+     * Return the byte offset if available
+     *
+     * @return the byte offset into the input source or -1 if unavailable
+     */
+    public int getOffset();
+    
+    /**
+     * Return the line number if available
+     *
+     * @return the line number or -1 if unavailable 
+     */
+    public int getLineNumber();
+    
+    /**
+     * Return the column number if available
+     *
+     * @return the column number or -1 if unavailable
+     */
+    public int getColumnNumber();
+    
+    /**
+     * Return a reference to the object in the Java content tree if available
+     *
+     * @return a reference to the object in the Java content tree or null if
+     *         unavailable
+     */
+    public java.lang.Object getObject();
+    
+    /**
+     * Return a reference to the DOM Node if available
+     *
+     * @return a reference to the DOM Node or null if unavailable 
+     */
+    public org.w3c.dom.Node getNode();
+    
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/ValidationException.java b/jaxb-api/src/main/java/javax/xml/bind/ValidationException.java
new file mode 100644
index 0000000..f189bc1
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/ValidationException.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * a validate operation.
+ * 
+ * <p>
+ * The {@code ValidationEventHandler} can cause this exception to be thrown
+ * during the validate operations.  See 
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @see JAXBException
+ * @see Validator
+ * @since 1.6, JAXB 1.0
+ */
+public class ValidationException extends JAXBException {
+
+    /** 
+     * Construct an ValidationException with the specified detail message.  The 
+     * errorCode and linkedException will default to null.
+     *
+     * @param message a description of the exception
+     */
+    public ValidationException(String message) {
+        this( message, null, null );
+    }
+
+    /** 
+     * Construct an ValidationException with the specified detail message and vendor 
+     * specific errorCode.  The linkedException will default to null.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     */
+    public ValidationException(String message, String errorCode) {
+        this( message, errorCode, null );
+    }
+
+    /** 
+     * Construct an ValidationException with a linkedException.  The detail message and
+     * vendor specific errorCode will default to null.
+     *
+     * @param exception the linked exception
+     */
+    public ValidationException(Throwable exception) {
+        this( null, null, exception );
+    }
+
+    /** 
+     * Construct an ValidationException with the specified detail message and 
+     * linkedException.  The errorCode will default to null.
+     *
+     * @param message a description of the exception
+     * @param exception the linked exception
+     */
+    public ValidationException(String message, Throwable exception) {
+        this( message, null, exception );
+    }
+
+    /** 
+     * Construct an ValidationException with the specified detail message, vendor 
+     * specific errorCode, and linkedException.
+     *
+     * @param message a description of the exception
+     * @param errorCode a string specifying the vendor specific error code
+     * @param exception the linked exception
+     */
+    public ValidationException(String message, String errorCode, Throwable exception) {
+        super( message, errorCode, exception );
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/Validator.java b/jaxb-api/src/main/java/javax/xml/bind/Validator.java
new file mode 100644
index 0000000..0bb2685
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/Validator.java
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * As of JAXB 2.0, this class is deprecated and optional.
+ * <p>
+ * The {@code Validator} class is responsible for controlling the validation
+ * of content trees during runtime.
+ *
+ * <p>
+ * <a name="validationtypes"></a>
+ * <b>Three Forms of Validation</b><br>
+ * <blockquote>
+ *    <dl>
+ *        <dt><b>Unmarshal-Time Validation</b></dt>
+ *        <dd>This form of validation enables a client application to receive 
+ *            information about validation errors and warnings detected while
+ *            unmarshalling XML data into a Java content tree and is completely 
+ *            orthogonal to the other types of validation.  To enable or disable 
+ *            it, see the javadoc for 
+ *            {@link Unmarshaller#setValidating(boolean) Unmarshaller.setValidating}.
+ *            All JAXB 1.0 Providers are required to support this operation.
+ *        </dd>
+ *
+ *        <dt><b>On-Demand Validation</b></dt>
+ *        <dd> This form of validation enables a client application to receive 
+ *             information about validation errors and warnings detected in the 
+ *             Java content tree.  At any point, client applications can call
+ *             the {@link Validator#validate(Object) Validator.validate} method
+ *             on the Java content tree (or any sub-tree of it).  All JAXB 1.0
+ *             Providers are required to support this operation.
+ *        </dd>
+ *
+ *        <dt><b>Fail-Fast Validation</b></dt>
+ *        <dd> This form of validation enables a client application to receive 
+ *             immediate feedback about modifications to the Java content tree 
+ *             that violate type constraints on Java Properties as defined in 
+ *             the specification.  JAXB Providers are not required support
+ *             this type of validation.  Of the JAXB Providers that do support
+ *             this type of validation, some may require you to decide at schema
+ *             compile time whether or not a client application will be allowed
+ *             to request fail-fast validation at runtime.
+ *        </dd>
+ *    </dl>
+ * </blockquote>
+ *
+ * <p>
+ * The {@code Validator} class is responsible for managing On-Demand Validation.
+ * The {@code Unmarshaller} class is responsible for managing Unmarshal-Time
+ * Validation during the unmarshal operations.  Although there is no formal
+ * method of enabling validation during the marshal operations, the 
+ * {@code Marshaller} may detect errors, which will be reported to the
+ * {@code ValidationEventHandler} registered on it.
+ *
+ * <p>
+ * <a name="defaulthandler"></a>
+ * <b>Using the Default EventHandler</b><br>
+ * <blockquote>
+ *   If the client application does not set an event handler on their
+ *   {@code Validator}, {@code Unmarshaller}, or {@code Marshaller} prior to
+ *   calling the validate, unmarshal, or marshal methods, then a default event 
+ *   handler will receive notification of any errors or warnings encountered.  
+ *   The default event handler will cause the current operation to halt after 
+ *   encountering the first error or fatal error (but will attempt to continue 
+ *   after receiving warnings).
+ * </blockquote>
+ *
+ * <p>
+ * <a name="handlingevents"></a>
+ * <b>Handling Validation Events</b><br>
+ * <blockquote>
+ *   There are three ways to handle events encountered during the unmarshal,
+ *   validate, and marshal operations:
+ *    <dl>
+ *        <dt>Use the default event handler</dt>
+ *        <dd>The default event handler will be used if you do not specify one
+ *            via the {@code setEventHandler} API's on {@code Validator},
+ *            {@code Unmarshaller}, or {@code Marshaller}.
+ *        </dd>
+ * 
+ *        <dt>Implement and register a custom event handler</dt>
+ *        <dd>Client applications that require sophisticated event processing
+ *            can implement the {@code ValidationEventHandler} interface and
+ *            register it with the {@code Unmarshaller} and/or
+ *            {@code Validator}.
+ *        </dd>
+ *
+ *        <dt>Use the {@link javax.xml.bind.util.ValidationEventCollector ValidationEventCollector} 
+ *            utility</dt>
+ *        <dd>For convenience, a specialized event handler is provided that
+ *            simply collects any {@code ValidationEvent} objects created
+ *            during the unmarshal, validate, and marshal operations and 
+ *            returns them to the client application as a 
+ *            {@code java.util.Collection}.
+ *        </dd>
+ *    </dl>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * Validation events are handled differently depending on how the client 
+ * application is configured to process them as described in the previous
+ * section.  However, there are certain cases where a JAXB Provider indicates
+ * that it is no longer able to reliably detect and report errors.  In these
+ * cases, the JAXB Provider will set the severity of the ValidationEvent to
+ * FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations 
+ * should be terminated.  The default event handler and 
+ * {@code ValidationEventCollector} utility class must terminate processing
+ * after being notified of a fatal error.  Client applications that supply their 
+ * own {@code ValidationEventHandler} should also terminate processing after
+ * being notified of a fatal error.  If not, unexpected behaviour may occur.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * There currently are not any properties required to be supported by all 
+ * JAXB Providers on Validator.  However, some providers may support 
+ * their own set of provider specific properties.
+ * </blockquote>
+ * 
+ * 
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see JAXBContext
+ * @see Unmarshaller
+ * @see ValidationEventHandler
+ * @see ValidationEvent
+ * @see javax.xml.bind.util.ValidationEventCollector
+ * @since 1.6, JAXB 1.0
+ * @deprecated since JAXB 2.0
+ */
+public interface Validator {
+
+    /**
+     * Allow an application to register a validation event handler.
+     * <p>
+     * The validation event handler will be called by the JAXB Provider if any
+     * validation errors are encountered during calls to 
+     * {@link #validate(Object) validate}.  If the client application does not 
+     * register a validation event handler before invoking the validate method, 
+     * then validation events will be handled by the default event handler which
+     * will terminate the validate operation after the first error or fatal error
+     * is encountered.
+     * <p>
+     * Calling this method with a null parameter will cause the Validator
+     * to revert back to the default default event handler.
+     *
+     * @param handler the validation event handler
+     * @throws JAXBException if an error was encountered while setting the
+     *         event handler
+     * @deprecated since JAXB2.0
+     */
+    public void setEventHandler( ValidationEventHandler handler )
+        throws JAXBException;
+
+    /**
+     * Return the current event handler or the default event handler if one
+     * hasn't been set.
+     *
+     * @return the current ValidationEventHandler or the default event handler
+     *         if it hasn't been set
+     * @throws JAXBException if an error was encountered while getting the 
+     *         current event handler
+     * @deprecated since JAXB2.0
+     */
+    public ValidationEventHandler getEventHandler()
+        throws JAXBException;
+        
+    /**
+     * Validate the Java content tree starting at {@code subrootObj}.
+     * <p>
+     * Client applications can use this method to validate Java content trees
+     * on-demand at runtime.  This method can be used to validate any arbitrary
+     * subtree of the Java content tree.  Global constraint checking <b>will not
+     * </b> be performed as part of this operation (i.e. ID/IDREF constraints).
+     *
+     * @param subrootObj the obj to begin validation at
+     * @throws JAXBException if any unexpected problem occurs during validation
+     * @throws ValidationException 
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Validator} is unable to validate the content tree rooted
+     *     at {@code subrootObj}
+     * @throws IllegalArgumentException
+     *      If the subrootObj parameter is null
+     * @return true if the subtree rooted at {@code subrootObj} is valid, false
+     *         otherwise
+     * @deprecated since JAXB2.0
+     */
+    public boolean validate( Object subrootObj ) throws JAXBException;
+    
+    /**
+     * Validate the Java content tree rooted at {@code rootObj}.
+     * <p>
+     * Client applications can use this method to validate Java content trees
+     * on-demand at runtime.  This method is used to validate an entire Java
+     * content tree.  Global constraint checking <b>will</b> be performed as 
+     * part of this operation (i.e. ID/IDREF constraints).
+     *
+     * @param rootObj the root obj to begin validation at
+     * @throws JAXBException if any unexpected problem occurs during validation
+     * @throws ValidationException 
+     *     If the {@link ValidationEventHandler ValidationEventHandler}
+     *     returns false from its {@code handleEvent} method or the
+     *     {@code Validator} is unable to validate the content tree rooted
+     *     at {@code rootObj}
+     * @throws IllegalArgumentException
+     *      If the rootObj parameter is null
+     * @return true if the tree rooted at {@code rootObj} is valid, false
+     *         otherwise
+     * @deprecated since JAXB2.0
+     */
+    public boolean validateRoot( Object rootObj ) throws JAXBException;
+
+    /**
+     * Set the particular property in the underlying implementation of 
+     * {@code Validator}.  This method can only be used to set one of
+     * the standard JAXB defined properties above or a provider specific
+     * property.  Attempting to set an undefined property will result in
+     * a PropertyException being thrown.  See <a href="#supportedProps">
+     * Supported Properties</a>.
+     *
+     * @param name the name of the property to be set. This value can either
+     *              be specified using one of the constant fields or a user 
+     *              supplied string.
+     * @param value the value of the property to be set
+     *
+     * @throws PropertyException when there is an error processing the given
+     *                            property or value
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     * @deprecated since JAXB2.0
+     */
+    public void setProperty( String name, Object value ) 
+        throws PropertyException;
+    
+    /**
+     * Get the particular property in the underlying implementation of 
+     * {@code Validator}.  This method can only be used to get one of
+     * the standard JAXB defined properties above or a provider specific
+     * property.  Attempting to get an undefined property will result in
+     * a PropertyException being thrown.  See <a href="#supportedProps">
+     * Supported Properties</a>.
+     *
+     * @param name the name of the property to retrieve
+     * @return the value of the requested property
+     *
+     * @throws PropertyException
+     *      when there is an error retrieving the given property or value
+     *      property name
+     * @throws IllegalArgumentException
+     *      If the name parameter is null
+     * @deprecated since JAXB2.0
+     */
+    public Object getProperty( String name ) throws PropertyException;
+    
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/WhiteSpaceProcessor.java b/jaxb-api/src/main/java/javax/xml/bind/WhiteSpaceProcessor.java
new file mode 100644
index 0000000..25f9deb
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/WhiteSpaceProcessor.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+/**
+ * Processes white space normalization.
+ *
+ * @since 1.0
+ */
+abstract class WhiteSpaceProcessor {
+
+// benchmarking (see test/src/ReplaceTest.java in the CVS Attic)
+// showed that this code is slower than the current code.
+//
+//    public static String replace(String text) {
+//        final int len = text.length();
+//        StringBuffer result = new StringBuffer(len);
+//
+//        for (int i = 0; i < len; i++) {
+//            char ch = text.charAt(i);
+//            if (isWhiteSpace(ch))
+//                result.append(' ');
+//            else
+//                result.append(ch);
+//        }
+//
+//        return result.toString();
+//    }
+
+    public static String replace(String text) {
+        return replace( (CharSequence)text ).toString();
+    }
+
+    /**
+     * @since 2.0
+     */
+    public static CharSequence replace(CharSequence text) {
+        int i=text.length()-1;
+
+        // look for the first whitespace char.
+        while( i>=0 && !isWhiteSpaceExceptSpace(text.charAt(i)) )
+            i--;
+
+        if( i<0 )
+            // no such whitespace. replace(text)==text.
+            return text;
+
+        // we now know that we need to modify the text.
+        // allocate a char array to do it.
+        StringBuilder buf = new StringBuilder(text);
+
+        buf.setCharAt(i--,' ');
+        for( ; i>=0; i-- )
+            if( isWhiteSpaceExceptSpace(buf.charAt(i)))
+                buf.setCharAt(i,' ');
+
+        return new String(buf);
+    }
+
+    /**
+     * Equivalent of {@link String#trim()}.
+     * @since 2.0
+     */
+    public static CharSequence trim(CharSequence text) {
+        int len = text.length();
+        int start = 0;
+
+        while( start<len && isWhiteSpace(text.charAt(start)) )
+            start++;
+
+        int end = len-1;
+
+        while( end>start && isWhiteSpace(text.charAt(end)) )
+            end--;
+
+        if(start==0 && end==len-1)
+            return text;    // no change
+        else
+            return text.subSequence(start,end+1);
+    }
+
+    public static String collapse(String text) {
+        return collapse( (CharSequence)text ).toString();
+    }
+
+    /**
+     * This is usually the biggest processing bottleneck.
+     *
+     * @since 2.0
+     */
+    public static CharSequence collapse(CharSequence text) {
+        int len = text.length();
+
+        // most of the texts are already in the collapsed form.
+        // so look for the first whitespace in the hope that we will
+        // never see it.
+        int s=0;
+        while(s<len) {
+            if(isWhiteSpace(text.charAt(s)))
+                break;
+            s++;
+        }
+        if(s==len)
+            // the input happens to be already collapsed.
+            return text;
+
+        // we now know that the input contains spaces.
+        // let's sit down and do the collapsing normally.
+
+        StringBuilder result = new StringBuilder(len /*allocate enough size to avoid re-allocation*/ );
+
+        if(s!=0) {
+            for( int i=0; i<s; i++ )
+                result.append(text.charAt(i));
+            result.append(' ');
+        }
+
+        boolean inStripMode = true;
+        for (int i = s+1; i < len; i++) {
+            char ch = text.charAt(i);
+            boolean b = isWhiteSpace(ch);
+            if (inStripMode && b)
+                continue; // skip this character
+
+            inStripMode = b;
+            if (inStripMode)
+                result.append(' ');
+            else
+                result.append(ch);
+        }
+
+        // remove trailing whitespaces
+        len = result.length();
+        if (len > 0 && result.charAt(len - 1) == ' ')
+            result.setLength(len - 1);
+        // whitespaces are already collapsed,
+        // so all we have to do is to remove the last one character
+        // if it's a whitespace.
+
+        return result;
+    }
+
+    /**
+     * Returns true if the specified string is all whitespace.
+     */
+    public static final boolean isWhiteSpace(CharSequence s) {
+        for( int i=s.length()-1; i>=0; i-- )
+            if(!isWhiteSpace(s.charAt(i)))
+                return false;
+        return true;
+    }
+
+    /** returns true if the specified char is a white space character. */
+    public static final boolean isWhiteSpace(char ch) {
+        // most of the characters are non-control characters.
+        // so check that first to quickly return false for most of the cases.
+        if( ch>0x20 )   return false;
+
+        // other than we have to do four comparisons.
+        return ch == 0x9 || ch == 0xA || ch == 0xD || ch == 0x20;
+    }
+
+    /**
+     * Returns true if the specified char is a white space character
+     * but not 0x20.
+     */
+    protected static final boolean isWhiteSpaceExceptSpace(char ch) {
+        // most of the characters are non-control characters.
+        // so check that first to quickly return false for most of the cases.
+        if( ch>=0x20 )   return false;
+
+        // other than we have to do four comparisons.
+        return ch == 0x9 || ch == 0xA || ch == 0xD;
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java
new file mode 100644
index 0000000..15ecc21
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+/**
+ * Converts an element (and its descendants)
+ * from/to DOM (or similar) representation.
+ *
+ * <p>
+ * Implementations of this interface will be used in conjunction with
+ * {@link XmlAnyElement} annotation to map an element of XML into a representation
+ * of infoset such as W3C DOM.
+ *
+ * <p>
+ * Implementations hide how a portion of XML is converted into/from such
+ * DOM-like representation, allowing JAXB providers to work with arbitrary
+ * such library.
+ *
+ * <P>
+ * This interface is intended to be implemented by library writers
+ * and consumed by JAXB providers. None of those methods are intended to
+ * be called from applications.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+public interface DomHandler<ElementT,ResultT extends Result> {
+    /**
+     * When a JAXB provider needs to unmarshal a part of a document into an
+     * infoset representation, it first calls this method to create a
+     * {@link Result} object.
+     *
+     * <p>
+     * A JAXB provider will then send a portion of the XML
+     * into the given result. Such a portion always form a subtree
+     * of the whole XML document rooted at an element.
+     *
+     * @param errorHandler
+     *      if any error happens between the invocation of this method
+     *      and the invocation of {@link #getElement(Result)}, they
+     *      must be reported to this handler.
+     *
+     *      The caller must provide a non-null error handler.
+     *
+     *      The {@link Result} object created from this method
+     *      may hold a reference to this error handler.
+     *
+     * @return
+     *      null if the operation fails. The error must have been reported
+     *      to the error handler.
+     */
+    ResultT createUnmarshaller( ValidationEventHandler errorHandler );
+
+    /**
+     * Once the portion is sent to the {@link Result}. This method is called
+     * by a JAXB provider to obtain the unmarshalled element representation.
+     *
+     * <p>
+     * Multiple invocations of this method may return different objects.
+     * This method can be invoked only when the whole sub-tree are fed
+     * to the {@link Result} object.
+     *
+     * @param rt
+     *      The {@link Result} object created by {@link #createUnmarshaller(ValidationEventHandler)}.
+     *
+     * @return
+     *      null if the operation fails. The error must have been reported
+     *      to the error handler.
+     */
+    ElementT getElement(ResultT rt);
+
+    /**
+     * This method is called when a JAXB provider needs to marshal an element
+     * to XML.
+     *
+     * <p>
+     * If non-null, the returned {@link Source} must contain a whole document
+     * rooted at one element, which will then be weaved into a bigger document
+     * that the JAXB provider is marshalling.
+     *
+     * @param errorHandler
+     *      Receives any errors happened during the process of converting
+     *      an element into a {@link Source}.
+     *
+     *      The caller must provide a non-null error handler.
+     *
+     * @return
+     *      null if there was an error. The error should have been reported
+     *      to the handler.
+     */
+    Source marshal( ElementT n, ValidationEventHandler errorHandler );
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
new file mode 100644
index 0000000..0165ca0
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+/**
+ * {@link DomHandler} implementation for W3C DOM (<code>org.w3c.dom</code> package.)
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+public class W3CDomHandler implements DomHandler<Element,DOMResult> {
+
+    private DocumentBuilder builder;
+
+    /**
+     * Default constructor.
+     *
+     * It is up to a JAXB provider to decide which DOM implementation
+     * to use or how that is configured.
+     */
+    public W3CDomHandler() {
+        this.builder = null;
+    }
+
+    /**
+     * Constructor that allows applications to specify which DOM implementation
+     * to be used.
+     *
+     * @param builder
+     *      must not be null. JAXB uses this {@link DocumentBuilder} to create
+     *      a new element.
+     */
+    public W3CDomHandler(DocumentBuilder builder) {
+        if(builder==null)
+            throw new IllegalArgumentException();
+        this.builder = builder;
+    }
+
+    public DocumentBuilder getBuilder() {
+        return builder;
+    }
+
+    public void setBuilder(DocumentBuilder builder) {
+        this.builder = builder;
+    }
+
+    public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
+        if(builder==null)
+            return new DOMResult();
+        else
+            return new DOMResult(builder.newDocument());
+    }
+
+    public Element getElement(DOMResult r) {
+        // JAXP spec is ambiguous about what really happens in this case,
+        // so work defensively
+        Node n = r.getNode();
+        if( n instanceof Document ) {
+            return ((Document)n).getDocumentElement();
+        }
+        if( n instanceof Element )
+            return (Element)n;
+        if( n instanceof DocumentFragment )
+            return (Element)n.getChildNodes().item(0);
+
+        // if the result object contains something strange,
+        // it is not a user problem, but it is a JAXB provider's problem.
+        // That's why we throw a runtime exception.
+        throw new IllegalStateException(n.toString());
+    }
+
+    public Source marshal(Element element, ValidationEventHandler errorHandler) {
+        return new DOMSource(element);
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
new file mode 100644
index 0000000..fc8c40f
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+/**
+ * Used by XmlAccessorOrder to control the ordering of properties and
+ * fields in a JAXB bound class.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ * @see XmlAccessorOrder
+ */
+
+public enum XmlAccessOrder { 
+    /**
+     * The ordering of fields and properties in a class is undefined. 
+     */
+    UNDEFINED,
+    /**
+     * The ordering of fields and properties in a class is in
+     * alphabetical order as determined by the
+     * method java.lang.String.compareTo(String anotherString).
+     */
+    ALPHABETICAL
+}
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
new file mode 100644
index 0000000..a4f6688
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+
+
+/**
+ * Used by XmlAccessorType to control serialization of fields or
+ * properties. 
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ * @see XmlAccessorType
+ */
+
+public enum XmlAccessType {
+    /**
+     * Every getter/setter pair in a JAXB-bound class will be automatically
+     * bound to XML, unless annotated by {@link XmlTransient}.
+     *
+     * Fields are bound to XML only when they are explicitly annotated
+     * by some of the JAXB annotations.
+     */
+    PROPERTY,
+    /**
+     * Every non static, non transient field in a JAXB-bound class will be automatically
+     * bound to XML, unless annotated by {@link XmlTransient}.
+     *
+     * Getter/setter pairs are bound to XML only when they are explicitly annotated
+     * by some of the JAXB annotations.
+     */
+    FIELD,
+    /**
+     * Every public getter/setter pair and every public field will be
+     * automatically bound to XML, unless annotated by {@link XmlTransient}.
+     *
+     * Fields or getter/setter pairs that are private, protected, or 
+     * defaulted to package-only access are bound to XML only when they are
+     * explicitly annotated by the appropriate JAXB annotations.
+     */
+    PUBLIC_MEMBER,
+    /**
+     * None of the fields or properties is bound to XML unless they
+     * are specifically  annotated with some of the JAXB annotations.
+     */
+    NONE
+}
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
new file mode 100644
index 0000000..98ef2e2
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Inherited;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Controls the ordering of fields and properties in a class. </p>
+ *
+ * <h3>Usage </h3>
+ *
+ * <p> {@code @XmlAccessorOrder} annotation can be used with the following
+ * program elements:</p> 
+ * 
+ * <ul> 
+ *   <li> package</li>
+ *   <li> a top level class </li>
+ * </ul>
+ *
+ * <p> See "Package Specification" in {@code javax.xml.bind} package javadoc for
+ * additional common information.</p>
+ *
+ * <p>The effective {@link XmlAccessOrder} on a class is determined
+ * as follows:
+ *
+ * <ul>
+ *   <li> If there is a {@code @XmlAccessorOrder} on a class, then
+ *        it is used. </li>
+ *   <li> Otherwise, if a {@code @XmlAccessorOrder} exists on one of
+ *        its super classes, then it is inherited (by the virtue of
+ *        {@link Inherited})
+ *   <li> Otherwise, the {@code @XmlAccessorOrder} on the package
+ *        of the class is used, if it's there.
+ *   <li> Otherwise {@link XmlAccessOrder#UNDEFINED}.
+ * </ul>
+ *
+ * <p>This annotation can be used with the following annotations:
+ *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType}, 
+ *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes}, 
+ *    , {@link XmlJavaTypeAdapter}. It can also be used with the
+ *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ * @see XmlAccessOrder
+ */
+
+@Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+public @interface XmlAccessorOrder {
+	XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
new file mode 100644
index 0000000..85f2503
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Inherited;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Controls whether fields or Javabean properties are serialized by default. </p>
+ * 
+ * <p> <b> Usage </b> </p>
+ *
+ * <p> {@code @XmlAccessorType} annotation can be used with the following program elements:</p>
+ * 
+ * <ul> 
+ *   <li> package</li>
+ *   <li> a top level class </li>
+ * </ul>
+ *
+ * <p> See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>This annotation provides control over the default serialization
+ * of properties and fields in a class.
+ * 
+ * <p>The annotation {@code @XmlAccessorType} on a package applies to
+ * all classes in the package. The following inheritance
+ * semantics apply:
+ *
+ * <ul>
+ *   <li> If there is a {@code @XmlAccessorType} on a class, then it
+ *        is used. </li>  
+ *   <li> Otherwise, if a {@code @XmlAccessorType} exists on one of
+ *        its super classes, then it is inherited.
+ *   <li> Otherwise, the {@code @XmlAccessorType} on a package is
+ *        inherited.
+ * </ul>
+ * <p> <b> Defaulting Rules: </b> </p>
+ *
+ * <p>By default, if {@code @XmlAccessorType} on a package is absent,
+ * then the following package level annotation is assumed.</p>
+ * <pre>
+ *   &#64;XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ * </pre>
+ * <p> By default, if {@code @XmlAccessorType} on a class is absent,
+ * and none of its super classes is annotated with
+ * {@code @XmlAccessorType}, then the following default on the class
+ * is assumed: </p>
+ * <pre>
+ *   &#64;XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ * </pre>
+ * <p>This annotation can be used with the following annotations: 
+ *    {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder}, 
+ *    {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes}, 
+ *    , {@link XmlJavaTypeAdapter}. It can also be used with the
+ *    following annotations at the package level: {@link XmlJavaTypeAdapter}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ * @see XmlAccessType
+ */
+
+@Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+public @interface XmlAccessorType {
+
+    /**
+     * Specifies whether fields or properties are serialized. 
+     * 
+     * @see XmlAccessType
+     */
+    XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
new file mode 100644
index 0000000..219d8af
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.namespace.QName;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.Map;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a map of wildcard attributes.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The {@code @XmlAnyAttribute} annotation can be used with the
+ * following program elements: 
+ * <ul> 
+ *   <li> JavaBean property </li>
+ *   <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ * 
+ * The usage is subject to the following constraints:
+ * <ul> 
+ *   <li> At most one field or property in a class can be annotated
+ *        with {@code @XmlAnyAttribute}.  </li>
+ *   <li> The type of the property or the field must {@code java.util.Map} </li>
+ * </ul>
+ *
+ * <p>
+ * While processing attributes to be unmarshalled into a value class,
+ * each attribute that is not statically associated with another 
+ * JavaBean property, via {@link XmlAttribute}, is entered into the 
+ * wildcard attribute map represented by 
+ * {@link Map}&lt;{@link QName},{@link Object}&gt;. The attribute QName is the
+ * map's key. The key's value is the String value of the attribute.
+ *
+ * @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlAnyAttribute {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
new file mode 100644
index 0000000..d9684fc
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
@@ -0,0 +1,272 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.List;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Maps a JavaBean property to XML infoset representation and/or JAXB element.
+ *
+ * <p>
+ * This annotation serves as a "catch-all" property while unmarshalling 
+ * xml content into a instance of a JAXB annotated class. It typically
+ * annotates a multi-valued JavaBean property, but it can occur on
+ * single value JavaBean property. During unmarshalling, each xml element 
+ * that does not match a static &#64;XmlElement or &#64;XmlElementRef 
+ * annotation for the other JavaBean properties on the class, is added to this 
+ * "catch-all" property.
+ *
+ * <h2>Usages:</h2>
+ * <pre>
+ * &#64;XmlAnyElement
+ * public {@link Element}[] others;
+ * 
+ * // Collection of {@link Element} or JAXB elements.
+ * &#64;XmlAnyElement(lax="true")
+ * public {@link Object}[] others;
+ *
+ * &#64;XmlAnyElement
+ * private List&lt;{@link Element}&gt; nodes;
+ *
+ * &#64;XmlAnyElement
+ * private {@link Element} node;
+ * </pre>
+ *
+ * <h2>Restriction usage constraints</h2>
+ * <p>
+ * This annotation is mutually exclusive with
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlValue},
+ * {@link XmlElements}, {@link XmlID}, and {@link XmlIDREF}.
+ *
+ * <p>
+ * There can be only one {@link XmlAnyElement} annotated JavaBean property
+ * in a class and its super classes.
+ *
+ * <h2>Relationship to other annotations</h2>
+ * <p>
+ * This annotation can be used with {@link XmlJavaTypeAdapter}, so that users
+ * can map their own data structure to DOM, which in turn can be composed 
+ * into XML.
+ *
+ * <p>
+ * This annotation can be used with {@link XmlMixed} like this:
+ * <pre>
+ * // List of java.lang.String or DOM nodes.
+ * &#64;XmlAnyElement &#64;XmlMixed
+ * List&lt;Object&gt; others;
+ * </pre>
+ *
+ *
+ * <h2>Schema To Java example</h2>
+ *
+ * The following schema would produce the following Java class:
+ * <pre>{@code
+ * <xs:complexType name="foo">
+ *   <xs:sequence>
+ *     <xs:element name="a" type="xs:int" />
+ *     <xs:element name="b" type="xs:int" />
+ *     <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ *   </xs:sequence>
+ * </xs:complexType>
+ * }</pre>
+ *
+ * <pre>
+ * class Foo {
+ *   int a;
+ *   int b;
+ *   &#64;{@link XmlAnyElement}
+ *   List&lt;Element&gt; any;
+ * }
+ * </pre>
+ *
+ * It can unmarshal instances like
+ *
+ * <pre>{@code
+ * <foo xmlns:e="extra">
+ *   <a>1</a>
+ *   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
+ *   <b>3</b>
+ *   <e:other />
+ *   <c>5</c>     // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * </foo>
+ * }</pre>
+ *
+ *
+ *
+ * The following schema would produce the following Java class:
+ * <pre>{@code
+ * <xs:complexType name="bar">
+ *   <xs:complexContent>
+ *   <xs:extension base="foo">
+ *     <xs:sequence>
+ *       <xs:element name="c" type="xs:int" />
+ *       <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ *     </xs:sequence>
+ *   </xs:extension>
+ * </xs:complexType>
+ * }</pre>
+ *
+ * <pre>
+ * class Bar extends Foo {
+ *   int c;
+ *   // Foo.getAny() also represents wildcard content for type definition bar.
+ * }
+ * </pre>
+ *
+ *
+ * It can unmarshal instances like
+ *
+ * <pre>{@code
+ * <bar xmlns:e="extra">
+ *   <a>1</a>
+ *   <e:other />  // this will be bound to DOM, because unmarshalling is orderless
+ *   <b>3</b>
+ *   <e:other />
+ *   <c>5</c>     // this now goes to Bar.c
+ *   <e:other />  // this will go to Foo.any
+ * </bar>
+ * }</pre>
+ *
+ *
+ *
+ *
+ * <h2>Using {@link XmlAnyElement} with {@link XmlElementRef}</h2>
+ * <p>
+ * The {@link XmlAnyElement} annotation can be used with {@link XmlElementRef}s to
+ * designate additional elements that can participate in the content tree.
+ *
+ * <p>
+ * The following schema would produce the following Java class:
+ * <pre>{@code
+ * <xs:complexType name="foo">
+ *   <xs:choice maxOccurs="unbounded" minOccurs="0">
+ *     <xs:element name="a" type="xs:int" />
+ *     <xs:element name="b" type="xs:int" />
+ *     <xs:any namespace="##other" processContents="lax" />
+ *   </xs:choice>
+ * </xs:complexType>
+ * }</pre>
+ *
+ * <pre>
+ * class Foo {
+ *   &#64;{@link XmlAnyElement}(lax="true")
+ *   &#64;{@link XmlElementRefs}({
+ *     &#64;{@link XmlElementRef}(name="a", type="JAXBElement.class")
+ *     &#64;{@link XmlElementRef}(name="b", type="JAXBElement.class")
+ *   })
+ *   {@link List}&lt;{@link Object}&gt; others;
+ * }
+ *
+ * &#64;XmlRegistry
+ * class ObjectFactory {
+ *   ...
+ *   &#64;XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
+ *   {@link JAXBElement}&lt;Integer&gt; createFooA( Integer i ) { ... }
+ *
+ *   &#64;XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
+ *   {@link JAXBElement}&lt;Integer&gt; createFooB( Integer i ) { ... }
+ * </pre>
+ *
+ * It can unmarshal instances like
+ *
+ * <pre>
+ *{@code <foo xmlns:e="extra">}
+ *{@code   <a>1</a>}     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *{@code   <e:other />}  // this will unmarshal to a DOM {@link Element}.
+ *{@code   <b>3</b>}     // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ *{@code </foo>}
+ * </pre>
+ *
+ *
+ *
+ *
+ * <h2>W3C XML Schema "lax" wildcard emulation</h2>
+ * The lax element of the annotation enables the emulation of the "lax" wildcard semantics.
+ * For example, when the Java source code is annotated like this:
+ * <pre>
+ * &#64;{@link XmlRootElement}
+ * class Foo {
+ *   &#64;XmlAnyElement(lax=true)
+ *   public {@link Object}[] others;
+ * }
+ * </pre>
+ * then the following document will unmarshal like this:
+ * <pre>{@code
+ * <foo>
+ *   <unknown />
+ *   <foo />
+ * </foo>
+ *
+ * Foo foo = unmarshal();
+ * // 1 for 'unknown', another for 'foo'
+ * assert foo.others.length==2;
+ * // 'unknown' unmarshals to a DOM element
+ * assert foo.others[0] instanceof Element;
+ * // because of lax=true, the 'foo' element eagerly
+ * // unmarshals to a Foo object.
+ * assert foo.others[1] instanceof Foo;
+ * }</pre>
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlAnyElement {
+
+    /**
+     * Controls the unmarshaller behavior when it sees elements
+     * known to the current {@link JAXBContext}.
+     *
+     * <h3>When false</h3>
+     * <p>
+     * If false, all the elements that match the property will be unmarshalled
+     * to DOM, and the property will only contain DOM elements.
+     *
+     * <h3>When true</h3>
+     * <p>
+     * If true, when an element matches a property marked with {@link XmlAnyElement}
+     * is known to {@link JAXBContext} (for example, there's a class with
+     * {@link XmlRootElement} that has the same tag name, or there's
+     * {@link XmlElementDecl} that has the same tag name),
+     * the unmarshaller will eagerly unmarshal this element to the JAXB object,
+     * instead of unmarshalling it to DOM. Additionally, if the element is
+     * unknown but it has a known xsi:type, the unmarshaller eagerly unmarshals
+     * the element to a {@link JAXBElement}, with the unknown element name and
+     * the JAXBElement value is set to an instance of the JAXB mapping of the 
+     * known xsi:type.
+     *
+     * <p>
+     * As a result, after the unmarshalling, the property can become heterogeneous;
+     * it can have both DOM nodes and some JAXB objects at the same time.
+     *
+     * <p>
+     * This can be used to emulate the "lax" wildcard semantics of the W3C XML Schema.
+     */
+    boolean lax() default false;
+
+    /**
+     * Specifies the {@link DomHandler} which is responsible for actually
+     * converting XML from/to a DOM-like data structure.
+     */
+    Class<? extends DomHandler> value() default W3CDomHandler.class;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
new file mode 100644
index 0000000..ae9a9c7
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.activation.DataHandler;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a field/property that its XML form is a uri reference to mime content.
+ * The mime content is optimally stored out-of-line as an attachment.
+ *
+ * A field/property must always map to the {@link DataHandler} class.
+ *
+ * <h2>Usage</h2>
+ * <pre>
+ * &#64;{@link XmlRootElement}
+ * class Foo {
+ *   &#64;{@link XmlAttachmentRef}
+ *   &#64;{@link XmlAttribute}
+ *   {@link DataHandler} data;
+ *
+ *   &#64;{@link XmlAttachmentRef}
+ *   &#64;{@link XmlElement}
+ *   {@link DataHandler} body;
+ * }
+ * </pre>
+ * The above code maps to the following XML:
+ * <pre>{@code
+ * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
+ *   <xs:complexType>
+ *     <xs:sequence>
+ *       <xs:element name="body" type="ref:swaRef" minOccurs="0" />
+ *     </xs:sequence>
+ *     <xs:attribute name="data" type="ref:swaRef" use="optional" />
+ *   </xs:complexType>
+ * </xs:element>
+ * }</pre>
+ *
+ * <p>
+ * The above binding supports WS-I AP 1.0 <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD,PARAMETER})
+public @interface XmlAttachmentRef {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
new file mode 100644
index 0000000..d08b004
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a XML attribute. 
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The {@code @XmlAttribute} annotation can be used with the
+ * following program elements: 
+ * <ul> 
+ *   <li> JavaBean property </li>
+ *   <li> field </li>
+ * </ul>
+ *
+ * <p> A static final field is mapped to a XML fixed attribute.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ *   <li> If type of the field or the property is a collection
+ *        type, then the collection item type must be mapped to schema
+ *        simple type.
+ * <pre>
+ *     // Examples
+ *     &#64;XmlAttribute List&lt;Integer&gt; items; //legal
+ *     &#64;XmlAttribute List&lt;Bar&gt; foo; // illegal if Bar does not map to a schema simple type
+ * </pre> 
+ *   </li>
+ *   <li> If the type of the field or the property is a non
+ *         collection type, then the type of the property or field
+ *         must map to a simple schema type.
+ * <pre>
+ *     // Examples
+ *     &#64;XmlAttribute int foo; // legal
+ *     &#64;XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
+ * </pre>
+ *   </li>
+ *   <li> This annotation can be used with the following annotations:
+ *            {@link XmlID}, 
+ *            {@link XmlIDREF},
+ *            {@link XmlList},
+ *            {@link XmlSchemaType},
+ *            {@link XmlValue},
+ *            {@link XmlAttachmentRef},
+ *            {@link XmlMimeType},
+ *            {@link XmlInlineBinaryData},
+ *            {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.</li>
+ * </ul>
+ *
+ * <p> <b>Example 1: </b>Map a JavaBean property to an XML attribute.</p>
+ * <pre>
+ *     //Example: Code fragment
+ *     public class USPrice { 
+ *         &#64;XmlAttribute
+ *         public java.math.BigDecimal getPrice() {...} ;
+ *         public void setPrice(java.math.BigDecimal ) {...};
+ *     }
+ * {@code
+ * 
+ *     <!-- Example: XML Schema fragment -->
+ *     <xs:complexType name="USPrice">
+ *       <xs:sequence>
+ *       </xs:sequence>
+ *       <xs:attribute name="price" type="xs:decimal"/>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * <p> <b>Example 2: </b>Map a JavaBean property to an XML attribute with anonymous type.</p>
+ * See Example 7 in @{@link XmlType}.
+ *
+ * <p> <b>Example 3: </b>Map a JavaBean collection property to an XML attribute.</p>
+ * <pre>
+ *     // Example: Code fragment
+ *     class Foo {
+ *         ...
+ *         &#64;XmlAttribute List&lt;Integer&gt; items;
+ *     } 
+ * {@code
+ * 
+ *     <!-- Example: XML Schema fragment -->
+ *     <xs:complexType name="foo">
+ *     	 ...
+ *       <xs:attribute name="items">
+ *         <xs:simpleType>
+ *           <xs:list itemType="xs:int"/>
+ *         </xs:simpleType>
+ *     </xs:complexType>
+ *
+ * }</pre>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlType
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlAttribute {
+    /**
+     * Name of the XML Schema attribute. By default, the XML Schema
+     * attribute name is derived from the JavaBean property name.
+     *
+     */
+    String name() default "##default";
+ 
+    /**
+     * Specifies if the XML Schema attribute is optional or
+     * required. If true, then the JavaBean property is mapped to a
+     * XML Schema attribute that is required. Otherwise it is mapped
+     * to a XML Schema attribute that is optional.
+     *
+     */
+     boolean required() default false;
+
+    /**
+     * Specifies the XML target namespace of the XML Schema
+     * attribute.
+     * 
+     */
+    String namespace() default "##default" ;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java
new file mode 100644
index 0000000..b44c06c
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Maps a JavaBean property to a XML element derived from property name.
+ *
+ * <p> <b>Usage</b>
+ * <p>
+ * {@code @XmlElement} annotation can be used with the following program
+ * elements:
+ * <ul>
+ *   <li> a JavaBean property </li>
+ *   <li> non static, non transient field </li>
+ *   <li> within {@link XmlElements}
+ * </ul>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ *   <li> This annotation can be used with following annotations:
+ *            {@link XmlID},
+ *            {@link XmlIDREF},
+ *            {@link XmlList},
+ *            {@link XmlSchemaType},
+ *            {@link XmlValue},
+ *            {@link XmlAttachmentRef},
+ *            {@link XmlMimeType},
+ *            {@link XmlInlineBinaryData},
+ *            {@link XmlElementWrapper},
+ *            {@link XmlJavaTypeAdapter}</li>
+ *   <li> if the type of JavaBean property is a collection type of
+ *        array, an indexed property, or a parameterized list, and
+ *        this annotation is used with {@link XmlElements} then,
+ *        {@code @XmlElement.type()} must be DEFAULT.class since the
+ *        collection item type is already known. </li>
+ * </ul>
+ *
+ * <p>
+ * A JavaBean property, when annotated with @XmlElement annotation
+ * is mapped to a local element in the XML Schema complex type to
+ * which the containing class is mapped.
+ *
+ * <p>
+ * <b>Example 1: </b> Map a public non static non final field to local
+ * element
+ * <pre>
+ *     //Example: Code fragment
+ *     public class USPrice {
+ *        {@literal @}XmlElement(name="itemprice")
+ *         public java.math.BigDecimal price;
+ *     }
+ * {@code
+ *
+ *     <!-- Example: Local XML Schema element -->
+ *     <xs:complexType name="USPrice"/>
+ *       <xs:sequence>
+ *         <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
+ *       </sequence>
+ *     </xs:complexType>
+ *   }</pre>
+ * <p>
+ *
+ * <b> Example 2: </b> Map a field to a nillable element.
+ *   <pre>
+ *     //Example: Code fragment
+ *     public class USPrice {
+ *        {@literal @}XmlElement(nillable=true)
+ *         public java.math.BigDecimal price;
+ *     }
+ * {@code
+ *
+ *     <!-- Example: Local XML Schema element -->
+ *     <xs:complexType name="USPrice">
+ *       <xs:sequence>
+ *         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/>
+ *       </sequence>
+ *     </xs:complexType>
+ *   }</pre>
+ * <p>
+ * <b> Example 3: </b> Map a field to a nillable, required element.
+ *   <pre>
+ *     //Example: Code fragment
+ *     public class USPrice {
+ *        {@literal @}XmlElement(nillable=true, required=true)
+ *         public java.math.BigDecimal price;
+ *     }
+ * {@code
+ *
+ *     <!-- Example: Local XML Schema element -->
+ *     <xs:complexType name="USPrice">
+ *       <xs:sequence>
+ *         <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
+ *       </sequence>
+ *     </xs:complexType>
+ *   }</pre>
+ *
+ * <p> <b>Example 4: </b>Map a JavaBean property to an XML element
+ * with anonymous type.</p>
+ * <p>
+ * See Example 6 in @{@link XmlType}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD, PARAMETER})
+public @interface XmlElement {
+    /**
+     * Name of the XML Schema element.
+     * <p> If the value is "##default", then element name is derived from the
+     * JavaBean property name.
+     */
+    String name() default "##default";
+
+    /**
+     * Customize the element declaration to be nillable.
+     * <p>If nillable() is true, then the JavaBean property is
+     * mapped to a XML Schema nillable element declaration.
+     */
+    boolean nillable() default false;
+
+    /**
+     * Customize the element declaration to be required.
+     * <p>If required() is true, then Javabean property is mapped to
+     * an XML schema element declaration with minOccurs="1".
+     * maxOccurs is "1" for a single valued property and "unbounded"
+     * for a multivalued property.
+     * <p>If required() is false, then the Javabean property is mapped
+     * to XML Schema element declaration with minOccurs="0".
+     * maxOccurs is "1" for a single valued property and "unbounded"
+     * for a multivalued property.
+     */
+
+    boolean required() default false;
+
+    /**
+     * XML target namespace of the XML Schema element.
+     * <p>
+     * If the value is "##default", then the namespace is determined
+     * as follows:
+     * <ol>
+     *  <li>
+     *  If the enclosing package has {@link XmlSchema} annotation,
+     *  and its {@link XmlSchema#elementFormDefault() elementFormDefault}
+     *  is {@link XmlNsForm#QUALIFIED QUALIFIED}, then the namespace of
+     *  the enclosing class.
+     *
+     *  <li>
+     *  Otherwise {@literal ''} (which produces unqualified element in the default
+     *  namespace.
+     * </ol>
+     */
+    String namespace() default "##default";
+
+    /**
+     * Default value of this element.
+     *
+     * <p>
+     * The <pre>'\u0000'</pre> value specified as a default of this annotation element
+     * is used as a poor-man's substitute for null to allow implementations
+     * to recognize the 'no default value' state.
+     */
+    String defaultValue() default "\u0000";
+
+    /**
+     * The Java class being referenced.
+     */
+    Class type() default DEFAULT.class;
+
+    /**
+     * Used in {@link XmlElement#type()} to
+     * signal that the type be inferred from the signature
+     * of the property.
+     */
+    static final class DEFAULT {}
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
new file mode 100644
index 0000000..08720e5
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * Maps a factory method to a XML element.
+ *
+ * <p> <b>Usage</b> </p>
+ *
+ * The annotation creates a mapping between an XML schema element
+ * declaration and a <i> element factory method </i> that returns a
+ * JAXBElement instance representing the element
+ * declaration. Typically, the element factory method is generated
+ * (and annotated) from a schema into the ObjectFactory class in a
+ * Java package that represents the binding of the element
+ * declaration's target namespace. Thus, while the annotation syntax 
+ * allows &#64;XmlElementDecl to be used on any method, semantically
+ * its use is restricted to annotation of element factory method. 
+ *
+ * The usage is subject to the following constraints:
+ * 
+ * <ul>
+ *   <li> The class containing the element factory method annotated
+ *        with &#64;XmlElementDecl must be marked with {@link
+ *        XmlRegistry}. </li> 
+ *   <li> The element factory method must take one parameter
+ *        assignable to {@link Object}.</li> 
+ * </ul>
+ *
+ * <p><b>Example 1: </b>Annotation on a factory method
+ * <pre>
+ *     // Example: code fragment
+ *     &#64;XmlRegistry
+ *     class ObjectFactory {
+ *         &#64;XmlElementDecl(name="foo")
+ *         JAXBElement&lt;String&gt; createFoo(String s) { ... }
+ *     }
+ * </pre>
+ * <pre> {@code
+ * 
+ *     <!-- XML input -->
+ *     <foo>string</foo>
+ *
+ *     // Example: code fragment corresponding to XML input
+ *     JAXBElement<String> o =
+ *     (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
+ *     // print JAXBElement instance to show values
+ *     System.out.println(o.getName());   // prints  "{}foo"
+ *     System.out.println(o.getValue());  // prints  "string"
+ *     System.out.println(o.getValue().getClass()); // prints "java.lang.String"
+ *
+ *     <!-- Example: XML schema definition -->
+ *     <xs:element name="foo" type="xs:string"/>
+ * }</pre>
+ *
+ * <p><b>Example 2: </b> Element declaration with non local scope
+ * <p>
+ * The following example illustrates the use of scope annotation
+ * parameter in binding of element declaration in schema derived
+ * code. 
+ * <p>
+ * The following example may be replaced in a future revision of
+ * this javadoc.
+ * 
+ * <pre>{@code
+ *     <!-- Example: XML schema definition -->
+ *     <xs:schema>
+ *       <xs:complexType name="pea">
+ *         <xs:choice maxOccurs="unbounded">
+ *           <xs:element name="foo" type="xs:string"/>
+ *           <xs:element name="bar" type="xs:string"/>
+ *         </xs:choice>
+ *       </xs:complexType>
+ *       <xs:element name="foo" type="xs:int"/>
+ *     </xs:schema>
+ * }</pre> 
+ * <pre>
+ *     // Example: expected default binding
+ *     class Pea {
+ *         &#64;XmlElementRefs({
+ *             &#64;XmlElementRef(name="foo",type=JAXBElement.class)
+ *             &#64;XmlElementRef(name="bar",type=JAXBElement.class)
+ *         })
+ *         List&lt;JAXBElement&lt;String&gt;&gt; fooOrBar;
+ *     }
+ * 
+ *     &#64;XmlRegistry
+ *     class ObjectFactory {
+ *         &#64;XmlElementDecl(scope=Pea.class,name="foo")
+ *         JAXBElement&lt;String&gt; createPeaFoo(String s);
+ * 
+ *         &#64;XmlElementDecl(scope=Pea.class,name="bar")
+ *         JAXBElement&lt;String&gt; createPeaBar(String s);
+ * 
+ *         &#64;XmlElementDecl(name="foo")
+ *         JAXBElement&lt;Integer&gt; createFoo(Integer i);
+ *     }
+ * 
+ * </pre>
+ * Without scope createFoo and createPeaFoo would become ambiguous
+ * since both of them map to a XML schema element with the same local
+ * name "foo". 
+ *
+ * @see XmlRegistry
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({METHOD})
+public @interface XmlElementDecl {
+    /**
+     * scope of the mapping.
+     *
+     * <p>
+     * If this is not {@link XmlElementDecl.GLOBAL}, then this element
+     * declaration mapping is only active within the specified class.
+     */
+    Class scope() default GLOBAL.class;
+
+    /**
+     * namespace name of the XML element.
+     * <p>
+     * If the value is "##default", then the value is the namespace
+     * name for the package of the class containing this factory method.
+     *
+     * @see #name()
+     */
+    String namespace() default "##default";
+
+    /**
+     * local name of the XML element.
+     *
+     * <p>
+     * <b> Note to reviewers: </b> There is no default name; since
+     * the annotation is on a factory method, it is not clear that the
+     * method name can be derived from the factory method name.
+     * @see #namespace()
+     */
+    String name();
+
+    /**
+     * namespace name of a substitution group's head XML element.
+     * <p>
+     * This specifies the namespace name of the XML element whose local
+     * name is specified by {@code substitutionHeadName()}.
+     * <p> 
+     * If {@code susbtitutionHeadName()} is "", then this
+     * value can only be "##default". But the value is ignored since
+     * since this element is not part of susbtitution group when the
+     * value of {@code susbstitutionHeadName()} is "".
+     * <p>
+     * If {@code susbtitutionHeadName()} is not "" and the value is
+     * "##default", then the namespace name is the namespace name to 
+     * which the package of the containing class, marked with {@link
+     * XmlRegistry }, is mapped.
+     * <p>
+     * If {@code susbtitutionHeadName()} is not "" and the value is
+     * not "##default", then the value is the namespace name.
+     *
+     * @see #substitutionHeadName()
+     */
+    String substitutionHeadNamespace() default "##default";
+
+    /**
+     * XML local name of a substitution group's head element.
+     * <p>
+     * If the value is "", then this element is not part of any
+     * substitution group.
+     *
+     * @see #substitutionHeadNamespace()
+     */
+    String substitutionHeadName() default "";
+
+    /**
+     * Default value of this element.
+     *
+     * <p>
+     * The <pre>'\u0000'</pre> value specified as a default of this annotation element
+     * is used as a poor-man's substitute for null to allow implementations
+     * to recognize the 'no default value' state.
+     */
+    String defaultValue() default "\u0000";
+    
+    /**
+     * Used in {@link XmlElementDecl#scope()} to
+     * signal that the declaration is in the global scope.
+     */
+    public final class GLOBAL {}
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
new file mode 100644
index 0000000..f3e4416
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/** 
+ * <p>
+ * Maps a JavaBean property to a XML element derived from property's type.
+ * <p>
+ * <b>Usage</b>
+ * <p>
+ * {@code @XmlElementRef} annotation can be used with a
+ * JavaBean property or from within {@link XmlElementRefs}
+ * <p>
+ * This annotation dynamically associates an XML element name with the JavaBean
+ * property. When a JavaBean property is annotated with {@link
+ * XmlElement}, the XML element name is statically derived from the
+ * JavaBean property name. However, when this annotation is used, the
+ * XML element name is derived from the instance of the type of the
+ * JavaBean property at runtime.
+ *
+ * <h3> XML Schema substitution group support </h3>
+ * XML Schema allows a XML document author to use XML element names
+ * that were not statically specified in the content model of a
+ * schema using substitution groups. Schema derived code provides 
+ * support for substitution groups using an <i>element property</i>,
+ * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
+ * element property method signature is of the form:
+ * <pre>{@code
+ *     public void setTerm(JAXBElement<? extends Operator>);
+ *     public JAXBElement<? extends Operator> getTerm();
+ * }</pre>
+ * <p>
+ * An element factory method annotated with  {@link XmlElementDecl} is
+ * used to create a {@code JAXBElement} instance, containing an XML
+ * element name. The presence of {@code @XmlElementRef} annotation on an
+ * element property indicates that the element name from {@code JAXBElement}
+ * instance be used instead of deriving an XML element name from the
+ * JavaBean property name.
+ * 
+ * <p>
+ * The usage is subject to the following constraints:
+ * <ul>
+ *   <li> If the collection item type (for collection property) or
+ *        property type (for single valued property) is
+ *        {@link javax.xml.bind.JAXBElement}, then
+ *        {@code @XmlElementRef.name()} and {@code @XmlElementRef.namespace()} must
+ *        point an element factory method  with an @XmlElementDecl
+ *        annotation in a class annotated  with @XmlRegistry (usually
+ *        ObjectFactory class generated by  the schema compiler) :
+ *        <ul>
+ *            <li> @XmlElementDecl.name() must equal @XmlElementRef.name()  </li>
+ *            <li> @XmlElementDecl.namespace() must equal @XmlElementRef.namespace(). </li>
+ *        </ul>
+ *   </li>
+ *   <li> If the collection item type (for collection property) or
+ *        property type  (for single valued property) is not
+ *        {@link javax.xml.bind.JAXBElement}, then the type referenced by the
+ *        property or field must be annotated  with {@link XmlRootElement}. </li>
+ *   <li> This annotation can be used with the following annotations:
+ *        {@link XmlElementWrapper}, {@link XmlJavaTypeAdapter}.
+ *   </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example 1: Ant Task Example</b></p>
+ * The following Java class hierarchy models an Ant build
+ * script.  An Ant task corresponds to a class in the class
+ * hierarchy. The XML element name of an Ant task is indicated by the
+ * &#64;XmlRootElement annotation on its corresponding class.
+ * <pre>
+ *     &#64;XmlRootElement(name="target")
+ *     class Target {
+ *         // The presence of &#64;XmlElementRef indicates that the XML
+ *         // element name will be derived from the &#64;XmlRootElement 
+ *         // annotation on the type (for e.g. "jar" for JarTask). 
+ *         &#64;XmlElementRef
+ *         List&lt;Task&gt; tasks;
+ *     }
+ *
+ *     abstract class Task {
+ *     }
+ *
+ *     &#64;XmlRootElement(name="jar")
+ *     class JarTask extends Task {
+ *         ...
+ *     }
+ *
+ *     &#64;XmlRootElement(name="javac")
+ *     class JavacTask extends Task {
+ *         ...
+ *     }
+ * {@code
+ * 
+ *     <!-- XML Schema fragment -->
+ *     <xs:element name="target" type="Target">
+ *     <xs:complexType name="Target">
+ *       <xs:sequence>
+ *         <xs:choice maxOccurs="unbounded">
+ *           <xs:element ref="jar">
+ *           <xs:element ref="javac">
+ *         </xs:choice>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ *
+ * }</pre>
+ * <p>
+ * Thus the following code fragment:
+ * <pre>
+ *     Target target = new Target();
+ *     target.tasks.add(new JarTask());
+ *     target.tasks.add(new JavacTask());
+ *     marshal(target);
+ * </pre>
+ * will produce the following XML output:
+ * <pre>{@code
+ *     <target>
+ *       <jar>
+ *         ....
+ *       </jar>
+ *       <javac>
+ *         ....
+ *       </javac>
+ *     </target>
+ * }</pre>
+ * <p>
+ * It is not an error to have a class that extends {@code Task}
+ * that doesn't have {@link XmlRootElement}. But they can't show up in an
+ * XML instance (because they don't have XML element names).
+ *
+ * <p><b>Example 2: XML Schema Susbstitution group support</b>
+ * <p> The following example shows the annotations for XML Schema
+ * substitution groups.  The annotations and the ObjectFactory are
+ * derived from the schema.
+ * 
+ * <pre>
+ *     &#64;XmlElement
+ *     class Math {
+ *         //  The value of {@link #type()}is 
+ *         //  JAXBElement.class , which indicates the XML
+ *         //  element name ObjectFactory - in general a class marked
+ *         //  with &#64;XmlRegistry. (See ObjectFactory below)
+ *         //  
+ *         //  The {@link #name()} is "operator", a pointer to a
+ *         // factory method annotated with a
+ *         //  {@link XmlElementDecl} with the name "operator". Since
+ *         //  "operator" is the head of a substitution group that
+ *         //  contains elements "add" and "sub" elements, "operator"
+ *         //  element can be substituted in an instance document by
+ *         //  elements "add" or "sub". At runtime, JAXBElement
+ *         //  instance contains the element name that has been
+ *         //  substituted in the XML document.
+ *         // 
+ *         &#64;XmlElementRef(type=JAXBElement.class,name="operator")
+ *         JAXBElement&lt;? extends Operator&gt; term;
+ *     }
+ *
+ *     &#64;XmlRegistry
+ *     class ObjectFactory {
+ *         &#64;XmlElementDecl(name="operator")
+ *         JAXBElement&lt;Operator&gt; createOperator(Operator o) {...}
+ *         &#64;XmlElementDecl(name="add",substitutionHeadName="operator")
+ *         JAXBElement&lt;Operator&gt; createAdd(Operator o) {...}
+ *         &#64;XmlElementDecl(name="sub",substitutionHeadName="operator")
+ *         JAXBElement&lt;Operator&gt; createSub(Operator o) {...}
+ *     }
+ *
+ *     class Operator {
+ *         ...
+ *     }
+ * </pre>
+ * <p>
+ * Thus, the following code fragment
+ * <pre>
+ *     Math m = new Math();
+ *     m.term = new ObjectFactory().createAdd(new Operator());
+ *     marshal(m);
+ * </pre>
+ * will produce the following XML output:
+ * <pre>{@code
+ *     <math>
+ *       <add>...</add>
+ *     </math>
+ * }</pre>
+ *
+ * 
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElementRefs
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlElementRef {
+    /**
+     * The Java type being referenced.
+     * <p>
+     * If the value is DEFAULT.class, the type is inferred from the
+     * the type of the JavaBean property.
+     */
+    Class type() default DEFAULT.class;
+
+    /**
+     * This parameter and {@link #name()} are used to determine the
+     * XML element for the JavaBean property.
+     *
+     * <p> If {@code type()} is {@code JAXBElement.class} , then
+     * {@code namespace()} and {@code name()}
+     * point to a factory method with {@link XmlElementDecl}. The XML
+     * element name is the element name from the factory method's
+     * {@link XmlElementDecl} annotation or if an element from its
+     * substitution group (of which it is a head element) has been
+     * substituted in the XML document, then the element name is from the
+     * {@link XmlElementDecl} on the substituted element.
+     *
+     * <p> If {@link #type()} is not {@code JAXBElement.class}, then
+     * the XML element name is the XML element name statically
+     * associated with the type using the annotation {@link
+     * XmlRootElement} on the type. If the type is not annotated with
+     * an {@link XmlElementDecl}, then it is an error.
+     *
+     * <p> If {@code type()} is not {@code JAXBElement.class}, then
+     * this value must be "". 
+     *
+     */
+    String namespace() default "";
+    /**
+     *
+     * @see #namespace()
+     */
+    String name() default "##default";
+
+    /**
+     * Used in {@link XmlElementRef#type()} to
+     * signal that the type be inferred from the signature
+     * of the property.
+     */
+    static final class DEFAULT {}
+
+    /**
+     * Customize the element declaration to be required.
+     * <p>
+     * If required() is true, then Javabean property is mapped to
+     * an XML schema element declaration with minOccurs="1".
+     * maxOccurs is "1" for a single valued property and "unbounded"
+     * for a multivalued property.
+     *
+     * <p>
+     * If required() is false, then the Javabean property is mapped
+     * to XML Schema element declaration with minOccurs="0".
+     * maxOccurs is "1" for a single valued property and "unbounded"
+     * for a multivalued property.
+     *
+     * <p>
+     * For compatibility with JAXB 2.1, this property defaults to {@code true},
+     * despite the fact that {@link XmlElement#required()} defaults to false.
+     *
+     * @since 1.7, JAXB 2.2
+     */
+    boolean required() default true;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
new file mode 100644
index 0000000..b010b56
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Marks a property that refers to classes with {@link XmlElement}
+ * or JAXBElement.
+ *
+ * <p>
+ * Compared to an element property (property with {@link XmlElement}
+ * annotation), a reference property has a different substitution semantics.
+ * When a sub-class is assigned to a property, an element property produces
+ * the same tag name with @xsi:type, whereas a reference property produces
+ * a different tag name (the tag name that's on the the sub-class.)
+ *
+ * <p> This annotation can be used with the following annotations: 
+ * {@link XmlJavaTypeAdapter}, {@link XmlElementWrapper}.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ *
+ * @see XmlElementWrapper
+ * @see XmlElementRef
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlElementRefs {
+    XmlElementRef[] value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
new file mode 100644
index 0000000..be2e7fb
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Generates a wrapper element around XML representation.
+ *
+ * This is primarily intended to be used to produce a wrapper
+ * XML element around collections. The annotation therefore supports
+ * two forms of serialization shown below. 
+ *
+ * <pre>{@code
+ *    //Example: code fragment
+ *      int[] names;
+ *
+ *    // XML Serialization Form 1 (Unwrapped collection)
+ *    <names> ... </names>
+ *    <names> ... </names>
+ * 
+ *    // XML Serialization Form 2 ( Wrapped collection )
+ *    <wrapperElement>
+ *       <names> value-of-item </names>
+ *       <names> value-of-item </names>
+ *       ....
+ *    </wrapperElement>
+ * }</pre>
+ *
+ * <p> The two serialized XML forms allow a null collection to be
+ * represented either by absence or presence of an element with a
+ * nillable attribute.
+ * 
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The {@code @XmlElementWrapper} annotation can be used with the
+ * following program elements: 
+ * <ul> 
+ *   <li> JavaBean property </li>
+ *   <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>The usage is subject to the following constraints:
+ * <ul>
+ *   <li> The property must be a collection property </li>
+ *   <li> This annotation can be used with the following annotations:
+ *            {@link XmlElement}, 
+ *            {@link XmlElements},
+ *            {@link XmlElementRef},
+ *            {@link XmlElementRefs},
+ *            {@link XmlJavaTypeAdapter}.</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElement 
+ * @see XmlElements
+ * @see XmlElementRef
+ * @see XmlElementRefs
+ * @since 1.6, JAXB 2.0
+ *
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlElementWrapper {
+    /**
+     * Name of the XML wrapper element. By default, the XML wrapper
+     * element name is derived from the JavaBean property name.
+     */
+    String name() default "##default";
+
+    /**
+     * XML target namespace of the XML wrapper element.
+     * <p>
+     * If the value is "##default", then the namespace is determined
+     * as follows:
+     * <ol>
+     *  <li>
+     *  If the enclosing package has {@link XmlSchema} annotation,
+     *  and its {@link XmlSchema#elementFormDefault() elementFormDefault}
+     *  is {@link XmlNsForm#QUALIFIED QUALIFIED}, then the namespace of
+     *  the enclosing class.
+     *
+     *  <li>
+     *  Otherwise "" (which produces unqualified element in the default
+     *  namespace.
+     * </ol>
+     */
+    String namespace() default "##default";
+
+    /**
+     * If true, the absence of the collection is represented by
+     * using {@code xsi:nil='true'}. Otherwise, it is represented by
+     * the absence of the element.
+     */
+    boolean nillable() default false;
+
+    /**
+     * Customize the wrapper element declaration to be required.
+     *
+     * <p>
+     * If required() is true, then the corresponding generated
+     * XML schema element declaration will have {@code minOccurs="1"},
+     * to indicate that the wrapper element is always expected.
+     *
+     * <p>
+     * Note that this only affects the schema generation, and
+     * not the unmarshalling or marshalling capability. This is
+     * simply a mechanism to let users express their application constraints
+     * better.
+     *
+     * @since 1.6, JAXB 2.1
+     */
+    boolean required() default false;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElements.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElements.java
new file mode 100644
index 0000000..d793101
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElements.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlElement} annotations.
+ *
+ * Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple &#64;XmlElements as follows:
+ *
+ * <pre>
+ * &#64;XmlElements({ @XmlElement(...),@XmlElement(...) })
+ * </pre>
+ *
+ * <p>The {@code @XmlElements} annotation can be used with the
+ * following program elements: </p>
+ * <ul>
+ *   <li> a JavaBean property </li>
+ *   <li> non static, non transient field </li>
+ * </ul>
+ *
+ * This annotation is intended for annotation a JavaBean collection
+ * property (e.g. List). 
+ *
+ * <p><b>Usage</b></p>
+ *
+ * <p>The usage is subject to the following constraints:
+ * <ul>
+ *   <li> This annotation can be used with the following
+ *        annotations: @{@link XmlIDREF}, @{@link XmlElementWrapper}. </li>
+ *   <li> If @XmlIDREF is also specified on the JavaBean property,
+ *        then each &#64;XmlElement.type() must contain a JavaBean
+ *        property annotated with {@code @XmlID}.</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <hr>
+ * 
+ * <p><b>Example 1:</b> Map to a list of elements</p>
+ * <pre>
+ *    
+ *    // Mapped code fragment
+ *    public class Foo {
+ *        &#64;XmlElements(
+ *            &#64;XmlElement(name="A", type=Integer.class),
+ *            &#64;XmlElement(name="B", type=Float.class)
+ *         )
+ *         public List items;
+ *    }
+ * {@code
+ * 
+ *    <!-- XML Representation for a List of {1,2.5} 
+ *            XML output is not wrapped using another element -->
+ *    ...
+ *    <A> 1 </A>
+ *    <B> 2.5 </B>
+ *    ...
+ *
+ *    <!-- XML Schema fragment -->
+ *    <xs:complexType name="Foo">
+ *      <xs:sequence>
+ *        <xs:choice minOccurs="0" maxOccurs="unbounded">
+ *          <xs:element name="A" type="xs:int"/>
+ *          <xs:element name="B" type="xs:float"/>
+ *        <xs:choice>
+ *      </xs:sequence>
+ *    </xs:complexType>
+ *
+ * }</pre>
+ *
+ * <p><b>Example 2:</b> Map to a list of elements wrapped with another element
+ * </p>
+ * <pre>
+ * 
+ *    // Mapped code fragment
+ *    public class Foo {
+ *        &#64;XmlElementWrapper(name="bar")
+ *        &#64;XmlElements(
+ *            &#64;XmlElement(name="A", type=Integer.class),
+ *            &#64;XmlElement(name="B", type=Float.class)
+ *        }
+ *        public List items;
+ *    }
+ * {@code
+ * 
+ *    <!-- XML Schema fragment -->
+ *    <xs:complexType name="Foo">
+ *      <xs:sequence>
+ *        <xs:element name="bar">
+ *          <xs:complexType>
+ *            <xs:choice minOccurs="0" maxOccurs="unbounded">
+ *              <xs:element name="A" type="xs:int"/>
+ *              <xs:element name="B" type="xs:float"/>
+ *            </xs:choice>
+ *          </xs:complexType>
+ *        </xs:element>
+ *      </xs:sequence>
+ *    </xs:complexType>
+ * }</pre>
+ *
+ * <p><b>Example 3:</b> Change element name based on type using an adapter. 
+ * </p>
+ * <pre>
+ *    class Foo {
+ *       &#64;XmlJavaTypeAdapter(QtoPAdapter.class)
+ *       &#64;XmlElements({
+ *           &#64;XmlElement(name="A",type=PX.class),
+ *           &#64;XmlElement(name="B",type=PY.class)
+ *       })
+ *       Q bar;
+ *    }
+ * 
+ *    &#64;XmlType abstract class P {...}
+ *    &#64;XmlType(name="PX") class PX extends P {...}
+ *    &#64;XmlType(name="PY") class PY extends P {...}
+ * {@code
+ * 
+ *    <!-- XML Schema fragment -->
+ *    <xs:complexType name="Foo">
+ *      <xs:sequence>
+ *        <xs:element name="bar">
+ *          <xs:complexType>
+ *            <xs:choice minOccurs="0" maxOccurs="unbounded">
+ *              <xs:element name="A" type="PX"/>
+ *              <xs:element name="B" type="PY"/>
+ *            </xs:choice>
+ *          </xs:complexType>
+ *        </xs:element>
+ *      </xs:sequence>
+ *    </xs:complexType>
+ * }</pre>
+ * 
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElement 
+ * @see XmlElementRef
+ * @see XmlElementRefs
+ * @see XmlJavaTypeAdapter
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME) @Target({FIELD,METHOD})
+public @interface XmlElements {
+    /**
+     * Collection of @{@link XmlElement} annotations
+     */
+    XmlElement[] value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnum.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnum.java
new file mode 100644
index 0000000..4be0bab
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnum.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Maps an enum type {@link Enum} to XML representation.
+ *
+ * <p>This annotation, together with {@link XmlEnumValue} provides a
+ * mapping of enum type to XML representation.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The {@code @XmlEnum} annotation can be used with the
+ * following program elements: 
+ * <ul> 
+ *   <li>enum type</li>
+ * </ul>
+ *
+ * <p> The usage is subject to the following constraints:
+ * <ul> 
+ *   <li> This annotation can be used the following other annotations: 
+ *         {@link XmlType},
+ *         {@link XmlRootElement} </li>
+ * </ul>
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information </p>
+ *
+ * <p>An enum type is mapped to a schema simple type with enumeration
+ * facets. The schema type is derived from the Java type to which 
+ * {@code @XmlEnum.value()}. Each enum constant {@code @XmlEnumValue}
+ * must have a valid lexical representation for the type 
+ * {@code @XmlEnum.value()}.
+ *
+ * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
+ *
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({TYPE})
+public @interface XmlEnum {
+    /**
+     * Java type that is mapped to a XML simple type.
+     *
+     */
+    Class<?> value() default String.class;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
new file mode 100644
index 0000000..cbce05d
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+
+/**
+ * Maps an enum constant in {@link Enum} type to XML representation.  
+ * 
+ * <p> <b>Usage</b> </p>
+ *
+ * <p> The {@code @XmlEnumValue} annotation can be used with the
+ *     following program elements:  
+ * <ul> 
+ *   <li>enum constant</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>This annotation, together with {@link XmlEnum} provides a
+ * mapping of enum type to XML representation.
+ *
+ * <p>An enum type is mapped to a schema simple type with enumeration
+ * facets. The schema type is derived from the Java type specified in
+ * {@code @XmlEnum.value()}. Each enum constant {@code @XmlEnumValue}
+ * must have a valid lexical representation for the type
+ * {@code @XmlEnum.value()}
+ *
+ * <p> In the absence of this annotation, {@link Enum#name()} is used
+ * as the XML representation.
+ *
+ * <p> <b>Example 1: </b>Map enum constant name {@literal ->} enumeration facet</p>
+ * <pre>
+ *     //Example: Code fragment
+ *     &#64;XmlEnum(String.class)
+ *     public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
+ * {@code
+ * 
+ *     <!-- Example: XML Schema fragment -->
+ *     <xs:simpleType name="Card">
+ *       <xs:restriction base="xs:string"/>
+ *         <xs:enumeration value="CLUBS"/>
+ *         <xs:enumeration value="DIAMONDS"/>
+ *         <xs:enumeration value="HEARTS"/>
+ *         <xs:enumeration value="SPADES"/>
+ *     </xs:simpleType>
+ * }</pre>
+ *
+ * <p><b>Example 2: </b>Map enum constant name(value) {@literal ->} enumeration facet </p>
+ * <pre>
+ *     //Example: code fragment
+ *     &#64;XmlType
+ *     &#64;XmlEnum(Integer.class)
+ *     public enum Coin { 
+ *         &#64;XmlEnumValue("1") PENNY(1),
+ *         &#64;XmlEnumValue("5") NICKEL(5),
+ *         &#64;XmlEnumValue("10") DIME(10),
+ *         &#64;XmlEnumValue("25") QUARTER(25) }
+ * {@code
+ * 
+ *     <!-- Example: XML Schema fragment -->
+ *     <xs:simpleType name="Coin">
+ *       <xs:restriction base="xs:int">
+ *         <xs:enumeration value="1"/>
+ *         <xs:enumeration value="5"/>
+ *         <xs:enumeration value="10"/>
+ *         <xs:enumeration value="25"/>
+ *       </xs:restriction>
+ *     </xs:simpleType>
+ * }</pre>
+ *
+ * <p><b>Example 3: </b>Map enum constant name {@literal ->} enumeration facet </p>
+ * 
+ * <pre>
+ *     //Code fragment
+ *     &#64;XmlType
+ *     &#64;XmlEnum(Integer.class)
+ *     public enum Code {
+ *         &#64;XmlEnumValue("1") ONE,
+ *         &#64;XmlEnumValue("2") TWO;
+ *     }
+ * {@code
+ * 
+ *     <!-- Example: XML Schema fragment -->
+ *     <xs:simpleType name="Code">
+ *       <xs:restriction base="xs:int">
+ *         <xs:enumeration value="1"/>
+ *         <xs:enumeration value="2"/>
+ *       </xs:restriction>
+ *     </xs:simpleType>
+ * }</pre>
+ *
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD})
+public @interface XmlEnumValue {
+    String value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlID.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlID.java
new file mode 100644
index 0000000..40acd7c
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlID.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to XML ID.
+ *
+ * <p>
+ * To preserve referential integrity of an object graph across XML
+ * serialization followed by a XML deserialization, requires an object
+ * reference to be marshalled by reference or containment
+ * appropriately. Annotations {@code @XmlID} and {@code @XmlIDREF}
+ * together allow a customized mapping of a JavaBean property's
+ * type by containment or reference. 
+ *
+ * <p><b>Usage</b> </p>
+ * The {@code @XmlID} annotation can be used with the following
+ * program elements: 
+ * <ul> 
+ *   <li> a JavaBean property </li>
+ *   <li> non static, non transient field </li>
+ * </ul>
+ * 
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul> 
+ *   <li> At most one field or property in a class can be annotated
+ *        with {@code @XmlID}.  </li>
+ *   <li> The JavaBean property's type must be {@code java.lang.String}.</li>
+ *   <li> The only other mapping annotations that can be used
+ *        with {@code @XmlID}
+ *        are: {@code @XmlElement} and {@code @XmlAttribute}.</li>
+ * </ul>
+ * 
+ * <p><b>Example</b>: Map a JavaBean property's type to {@code xs:ID}</p>
+ * <pre>
+ *    // Example: code fragment
+ *    public class Customer {
+ *        &#64;XmlAttribute
+ *        &#64;XmlID
+ *        public String getCustomerID();
+ *        public void setCustomerID(String id);
+ *        .... other properties not shown 
+ *    }
+ * {@code
+ * 
+ *    <!-- Example: XML Schema fragment -->
+ *    <xs:complexType name="Customer">
+ *      <xs:complexContent>
+ *        <xs:sequence>
+ *          ....
+ *        </xs:sequence>
+ *        <xs:attribute name="customerID" type="xs:ID"/>
+ *      </xs:complexContent>
+ *    </xs:complexType>
+ * }</pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlIDREF
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlID { }
+
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlIDREF.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
new file mode 100644
index 0000000..6642867
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to XML IDREF.
+ * 
+ * <p>
+ * To preserve referential integrity of an object graph across XML
+ * serialization followed by a XML deserialization, requires an object
+ * reference to be marshaled by reference or containment
+ * appropriately. Annotations {@code @XmlID} and {@code @XmlIDREF}
+ * together allow a customized mapping of a JavaBean property's
+ * type by containment or reference. 
+ *
+ * <p><b>Usage</b> </p>
+ * The {@code @XmlIDREF} annotation can be used with the following
+ * program elements: 
+ * <ul> 
+ *   <li> a JavaBean property </li>
+ *   <li> non static, non transient field </li>
+ * </ul>
+ * 
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p> The usage is subject to the following constraints:
+ * <ul>
+ *
+ *   <li> If the type of the field or property is a collection type,
+ *        then the collection item type must contain a property or
+ *        field annotated with {@code @XmlID}.  </li>
+ *   <li> If the field or property is single valued, then the type of
+ *        the property or field must contain a property or field
+ *        annotated with {@code @XmlID}.
+ *        <p>Note: If the collection item type or the type of the
+ *        property (for non collection type) is java.lang.Object, then
+ *        the instance must contain a property/field annotated with
+ *        {@code @XmlID} attribute.
+ *        </li>
+ *   <li> This annotation can be used with the following annotations:
+ *        {@link XmlElement}, {@link XmlAttribute}, {@link XmlList}, 
+ *        and {@link XmlElements}.</li>  
+ *
+ * </ul>
+ * <p><b>Example:</b> Map a JavaBean property to {@code xs:IDREF}
+ *   (i.e. by reference rather than by containment)</p>
+ * <pre>
+ *
+ *   //EXAMPLE: Code fragment
+ *   public class Shipping {
+ *       &#64;XmlIDREF public Customer getCustomer();
+ *       public void setCustomer(Customer customer);
+ *       ....
+ *    }
+ * {@code
+ * 
+ *   <!-- Example: XML Schema fragment -->
+ *   <xs:complexType name="Shipping">
+ *     <xs:complexContent>
+ *       <xs:sequence>
+ *         <xs:element name="customer" type="xs:IDREF"/>
+ *         ....
+ *       </xs:sequence>
+ *     </xs:complexContent>
+ *   </xs:complexType>
+ *
+ * }</pre>
+ *
+ *
+ * <p><b>Example 2: </b> The following is a complete example of
+ * containment versus reference.
+ * 
+ * <pre>
+ *    // By default, Customer maps to complex type {@code xs:Customer}
+ *    public class Customer {
+ *        
+ *        // map JavaBean property type to {@code xs:ID}
+ *        &#64;XmlID public String getCustomerID();
+ *        public void setCustomerID(String id);
+ *
+ *        // .... other properties not shown 
+ *    }
+ *
+ *
+ *   // By default, Invoice maps to a complex type {@code xs:Invoice}
+ *   public class Invoice {
+ *    
+ *       // map by reference
+ *       &#64;XmlIDREF public Customer getCustomer();       
+ *       public void setCustomer(Customer customer);
+ *
+ *      // .... other properties not shown here
+ *   }
+ *
+ *   // By default, Shipping maps to complex type {@code xs:Shipping}
+ *   public class Shipping {
+ *
+ *       // map by reference
+ *       &#64;XmlIDREF public Customer getCustomer();       
+ *       public void setCustomer(Customer customer);
+ *   }
+ *
+ *   // at least one class must reference Customer by containment;
+ *   // Customer instances won't be marshalled.
+ *   &#64;XmlElement(name="CustomerData")
+ *   public class CustomerData {
+ *       // map reference to Customer by containment by default.
+ *       public Customer getCustomer();
+ *
+ *       // maps reference to Shipping by containment by default. 
+ *       public Shipping getShipping();     
+ *
+ *       // maps reference to Invoice by containment by default. 
+ *       public Invoice getInvoice();     
+ *   }
+ * {@code
+ * 
+ *   <!-- XML Schema mapping for above code frament -->
+ *
+ *   <xs:complexType name="Invoice">
+ *     <xs:complexContent>
+ *       <xs:sequence>
+ *         <xs:element name="customer" type="xs:IDREF"/>
+ *         ....
+ *       </xs:sequence>
+ *     </xs:complexContent>
+ *   </xs:complexType>
+ *
+ *   <xs:complexType name="Shipping">
+ *     <xs:complexContent>
+ *       <xs:sequence>
+ *         <xs:element name="customer" type="xs:IDREF"/>
+ *         ....
+ *       </xs:sequence>
+ *     </xs:complexContent>
+ *   </xs:complexType>
+ *
+ *   <xs:complexType name="Customer">
+ *     <xs:complexContent>
+ *       <xs:sequence>
+ *         ....
+ *       </xs:sequence>
+ *       <xs:attribute name="CustomerID" type="xs:ID"/>
+ *     </xs:complexContent>
+ *   </xs:complexType>
+ *
+ *   <xs:complexType name="CustomerData">
+ *     <xs:complexContent>
+ *       <xs:sequence>
+ *         <xs:element name="customer" type="xs:Customer"/>
+ *         <xs:element name="shipping" type="xs:Shipping"/>
+ *         <xs:element name="invoice"  type="xs:Invoice"/>
+ *       </xs:sequence>
+ *     </xs:complexContent>
+ *   </xs:complexType>
+ *
+ *   <xs:element name"customerData" type="xs:CustomerData"/>
+ *
+ *   <!-- Instance document conforming to the above XML Schema -->
+ *    <customerData>
+ *       <customer customerID="Alice">
+ *           ....
+ *       </customer>
+ *
+ *       <shipping customer="Alice">
+ *           ....
+ *       </shipping>
+ *         
+ *       <invoice customer="Alice">
+ *           ....
+ *       </invoice>
+ *   </customerData>
+ *
+ * }</pre>
+ *
+ * <p><b>Example 3: </b> Mapping List to repeating element of type IDREF
+ * <pre>
+ *     // Code fragment
+ *     public class Shipping {
+ *         &#64;XmlIDREF
+ *         &#64;XmlElement(name="Alice")
+ *             public List customers;
+ *     }
+ * {@code
+ * 
+ *     <!-- XML schema fragment -->
+ *     <xs:complexType name="Shipping">
+ *       <xs:sequence>
+ *         <xs:choice minOccurs="0" maxOccurs="unbounded">
+ *           <xs:element name="Alice" type="xs:IDREF"/>
+ *         </xs:choice>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * <p><b>Example 4: </b> Mapping a List to a list of elements of type IDREF.
+ * <pre>
+ *     //Code fragment
+ *     public class Shipping {
+ *         &#64;XmlIDREF
+ *         &#64;XmlElements(
+ *             &#64;XmlElement(name="Alice", type="Customer.class")
+ *              &#64;XmlElement(name="John", type="InternationalCustomer.class")
+ *         public List customers;
+ *     }
+ * {@code
+ * 
+ *     <!-- XML Schema fragment -->
+ *     <xs:complexType name="Shipping">
+ *       <xs:sequence>
+ *         <xs:choice minOccurs="0" maxOccurs="unbounded">
+ *           <xs:element name="Alice" type="xs:IDREF"/>
+ *           <xs:element name="John" type="xs:IDREF"/>
+ *         </xs:choice>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ * }</pre>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc. 
+ * @see XmlID
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlIDREF {}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
new file mode 100644
index 0000000..63756ab
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import javax.xml.transform.Source;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.activation.DataHandler;
+
+/**
+ * Disable consideration of XOP encoding for datatypes that are bound to 
+ * base64-encoded binary data in XML.
+ *
+ * <p>
+ * When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()},
+ * this annotation disables datatypes such as {@link java.awt.Image} or {@link Source}
+ * or {@code byte[]} that are bound to base64-encoded binary from being considered for
+ * XOP encoding. If a JAXB property is annotated with this annotation or if
+ * the JAXB property's base type is annotated with this annotation, 
+ * neither 
+ * {@link AttachmentMarshaller#addMtomAttachment(DataHandler, String, String)}
+ * nor 
+ * {@link AttachmentMarshaller#addMtomAttachment(byte[], int, int, String, String, String)} is 
+ * ever called for the property. The binary data will always be inlined.
+ *
+ * @author Joseph Fialli
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD,TYPE})
+public @interface XmlInlineBinaryData {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlList.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlList.java
new file mode 100644
index 0000000..febd421
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlList.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+/**
+ * Used to map a property to a list simple type.
+ *
+ * <p><b>Usage</b> </p>
+ * <p>
+ * The {@code @XmlList} annotation can be used with the
+ * following program elements: 
+ * <ul> 
+ *   <li> JavaBean property </li>
+ *   <li> field </li>
+ * </ul>
+ *
+ * <p>
+ * When a collection property is annotated just with @XmlElement,
+ * each item in the collection will be wrapped by an element.
+ * For example,
+ *
+ * <pre>
+ * &#64;XmlRootElement
+ * class Foo {
+ *     &#64;XmlElement
+ *     List&lt;String&gt; data;
+ * }
+ * </pre>
+ *
+ * would produce XML like this:
+ *
+ * <pre>{@code
+ * <foo>
+ *   <data>abc</data>
+ *   <data>def</data>
+ * </foo>
+ * }</pre>
+ *
+ * &#64;XmlList annotation, on the other hand, allows multiple values to be 
+ * represented as whitespace-separated tokens in a single element. For example,
+ *
+ * <pre>
+ * &#64;XmlRootElement
+ * class Foo {
+ *     &#64;XmlElement
+ *     &#64;XmlList
+ *     List&lt;String&gt; data;
+ * }
+ * </pre>
+ *
+ * the above code will produce XML like this:
+ *
+ * <pre>{@code
+ * <foo>
+ *   <data>abc def</data>
+ * </foo>
+ * }</pre>
+ *
+ * <p>This annotation can be used with the following annotations:
+ *        {@link XmlElement}, 
+ *        {@link XmlAttribute},
+ *        {@link XmlValue},
+ *        {@link XmlIDREF}.
+ *  <ul>
+ *    <li> The use of {@code @XmlList} with {@link XmlValue} while
+ *         allowed, is redundant since  {@link XmlList} maps a
+ *         collection type to a simple schema type that derives by
+ *         list just as {@link XmlValue} would. </li> 
+ *
+ *    <li> The use of {@code @XmlList} with {@link XmlAttribute} while
+ *         allowed, is redundant since  {@link XmlList} maps a
+ *         collection type to a simple schema type that derives by
+ *         list just as {@link XmlAttribute} would. </li> 
+ *  </ul>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER})
+public @interface XmlList {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMimeType.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
new file mode 100644
index 0000000..aeac46e
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import javax.xml.transform.Source;
+
+/**
+ * Associates the MIME type that controls the XML representation of the property.
+ *
+ * <p>
+ * This annotation is used in conjunction with datatypes such as
+ * {@link java.awt.Image} or {@link Source} that are bound to base64-encoded binary in XML.
+ *
+ * <p>
+ * If a property that has this annotation has a sibling property bound to
+ * the xmime:contentType attribute, and if in the instance the property has a value,
+ * the value of the attribute takes precedence and that will control the marshalling. 
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD,PARAMETER})
+public @interface XmlMimeType {
+    /**
+     * The textual representation of the MIME type,
+     * such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.
+     */
+    String value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMixed.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMixed.java
new file mode 100644
index 0000000..43668d9
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMixed.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+import org.w3c.dom.Element;
+import javax.xml.bind.JAXBElement;
+
+/**
+ * <p>
+ * Annotate a JavaBean multi-valued property to support mixed content.
+ *
+ * <p>
+ * The usage is subject to the following constraints:
+ * <ul>
+ *   <li> can be used with &#64;XmlElementRef, &#64;XmlElementRefs or &#64;XmlAnyElement</li>
+ * </ul>
+ * <p>
+ * The following can be inserted into &#64;XmlMixed annotated multi-valued property
+ * <ul>
+ * <li>XML text information items are added as values of java.lang.String.</li>
+ * <li>Children element information items are added as instances of
+ * {@link JAXBElement} or instances with a class that is annotated with
+ * &#64;XmlRootElement.</li>
+ * <li>Unknown content that is not be bound to a JAXB mapped class is inserted
+ * as {@link Element}. (Assumes property annotated with &#64;XmlAnyElement)</li>
+ * </ul>
+ *
+ * Below is an example of binding and creation of mixed content.
+ * <pre>{@code
+ * 
+ *  <!-- schema fragment having  mixed content -->
+ *  <xs:complexType name="letterBody" mixed="true">
+ *    <xs:sequence>
+ *	<xs:element name="name" type="xs:string"/>
+ *	<xs:element name="quantity" type="xs:positiveInteger"/>
+ *	<xs:element name="productName" type="xs:string"/>
+ *	<!-- etc. -->
+ *    </xs:sequence>
+ *  </xs:complexType>
+ *  <xs:element name="letterBody" type="letterBody"/>
+ * 
+ * // Schema-derived Java code: 
+ * // (Only annotations relevant to mixed content are shown below, 
+ * //  others are omitted.)
+ * import java.math.BigInteger;
+ * public class ObjectFactory {
+ * 	// element instance factories
+ * 	JAXBElement<LetterBody> createLetterBody(LetterBody value);
+ * 	JAXBElement<String>     createLetterBodyName(String value);
+ * 	JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
+ * 	JAXBElement<String>     createLetterBodyProductName(String value);
+ *      // type instance factory
+ * 	LetterBody createLetterBody();
+ * }
+ * }</pre>
+ * <pre>
+ * public class LetterBody {
+ * 	// Mixed content can contain instances of Element classes
+ * 	// Name, Quantity and ProductName. Text data is represented as
+ *	// java.util.String for text.
+ *	&#64;XmlMixed 
+ * 	&#64;XmlElementRefs({
+ *		&#64;XmlElementRef(name="productName", type=JAXBElement.class),
+ *		&#64;XmlElementRef(name="quantity", type=JAXBElement.class),
+ *		&#64;XmlElementRef(name="name", type=JAXBElement.class)})
+ *	List getContent(){...}
+ * }
+ * </pre>
+ * The following is an XML instance document with mixed content
+ * <pre>{@code
+ * <letterBody>
+ * Dear Mr.<name>Robert Smith</name>
+ * Your order of <quantity>1</quantity> <productName>Baby
+ * Monitor</productName> shipped from our warehouse. ....
+ * </letterBody>
+ * }</pre>
+ * that can be constructed using following JAXB API calls.
+ * <pre>{@code
+ * LetterBody lb = ObjectFactory.createLetterBody();
+ * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+ * List gcl = lb.getContent();  //add mixed content to general content property.
+ * gcl.add("Dear Mr.");  // add text information item as a String.
+ * 
+ * // add child element information item
+ * gcl.add(ObjectFactory.createLetterBodyName("Robert Smith"));
+ * gcl.add("Your order of "); // add text information item as a String
+ * 
+ * // add children element information items
+ * gcl.add(ObjectFactory.
+ * 	 		createLetterBodyQuantity(new BigInteger("1")));
+ * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
+ * gcl.add("shipped from our warehouse");  // add text information item
+ * }</pre>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlMixed {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNs.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNs.java
new file mode 100644
index 0000000..f8cc674
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNs.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Associates a namespace prefix with a XML namespace URI.
+ *
+ * <p><b>Usage</b></p>
+ * <p>{@code @XmlNs} annotation is intended for use from other
+ * program annotations.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example:</b>See {@code XmlSchema} annotation type for an example.
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({})
+public @interface XmlNs {
+    /**
+     * Namespace prefix
+     */
+    String prefix();
+
+    /**
+     * Namespace URI
+     */
+    String namespaceURI(); 
+}
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNsForm.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
new file mode 100644
index 0000000..8cfe379
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+/**
+ * Enumeration of XML Schema namespace qualifications. 
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Usage</b>  
+ * <p>
+ * The namespace qualification values are used in the annotations
+ * defined in this packge. The enumeration values are mapped as follows:
+ *
+ * <table class="striped">
+ *   <caption style="display:none">Mapping of enumeration values</caption>
+ *   <thead>
+ *     <tr>
+ *       <th scope="col">Enum Value</th>
+ *       <th scope="col">XML Schema Value</th>
+ *     </tr>
+ *   </thead>
+ * 
+ *   <tbody>
+ *     <tr>
+ *       <th scope="row">UNQUALIFIED</th>
+ *       <td>unqualified</td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row">QUALIFIED</th>
+ *       <td>qualified</td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row">UNSET</th>
+ *       <td>namespace qualification attribute is absent from the
+ *           XML Schema fragment</td>
+ *     </tr>
+ *   </tbody>
+ * </table>
+ * 
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET}
+
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRegistry.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
new file mode 100644
index 0000000..4d113ea
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Marks a class that has {@link XmlElementDecl}s.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @since 1.6, JAXB 2.0
+ * @see XmlElementDecl
+ */
+@Retention(RUNTIME)
+@Target({TYPE})
+public @interface XmlRegistry {
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRootElement.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
new file mode 100644
index 0000000..33a9791
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.TYPE;
+
+/**
+ * Maps a class or an enum type to an XML element.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The &#64;XmlRootElement annotation can be used with the following program
+ * elements: 
+ * <ul> 
+ *   <li> a top level class </li>
+ *   <li> an enum type </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ * 
+ * <p>
+ * When a top level class or an enum type is annotated with the 
+ * &#64;XmlRootElement annotation, then its value is represented 
+ * as XML element in an XML document.
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType}, 
+ * {@link XmlAccessorOrder}.
+ * </p>
+
+ * <p>
+ * <b>Example 1: </b> Associate an element with XML Schema type
+ * <pre>
+ *     // Example: Code fragment
+ *     &#64;XmlRootElement
+ *     class Point {
+ *        int x;
+ *        int y;
+ *        Point(int _x,int _y) {x=_x;y=_y;}
+ *     }
+ * </pre>
+ *
+ * <pre>
+ *     //Example: Code fragment corresponding to XML output
+ *     marshal( new Point(3,5), System.out);
+ * </pre>
+ *
+ * <pre>{@code
+ * 
+ *     <!-- Example: XML output -->
+ *     <point>
+ *       <x> 3 </x>
+ *       <y> 5 </y>
+ *     </point>
+ * }</pre>
+ *
+ * The annotation causes an global element declaration to be produced
+ * in the schema. The global element declaration is associated with
+ * the XML schema type to which the class is mapped.
+ *
+ * <pre>{@code
+ * 
+ *     <!-- Example: XML schema definition -->
+ *     <xs:element name="point" type="point"/>
+ *     <xs:complexType name="point">
+ *       <xs:sequence>
+ *         <xs:element name="x" type="xs:int"/>
+ *         <xs:element name="y" type="xs:int"/>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * <p>
+ *
+ * <b>Example 2: Orthogonality to type inheritance </b>
+ * 
+ * <p>
+ * An element declaration annotated on a type is not inherited by its
+ * derived types. The following example shows this.
+ * <pre>
+ *     // Example: Code fragment
+ *     &#64;XmlRootElement
+ *     class Point3D extends Point {
+ *         int z;
+ *         Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
+ *     }
+ *
+ *     //Example: Code fragment corresponding to XML output * 
+ *     marshal( new Point3D(3,5,0), System.out );
+ * {@code
+ * 
+ *     <!-- Example: XML output -->
+ *     <!-- The element name is point3D not point -->
+ *     <point3D>
+ *       <x>3</x>
+ *       <y>5</y>
+ *       <z>0</z>
+ *     </point3D>
+ *
+ *     <!-- Example: XML schema definition -->
+ *     <xs:element name="point3D" type="point3D"/>
+ *     <xs:complexType name="point3D">
+ *       <xs:complexContent>
+ *         <xs:extension base="point">
+ *           <xs:sequence>
+ *             <xs:element name="z" type="xs:int"/>
+ *           </xs:sequence>
+ *         </xs:extension>
+ *       </xs:complexContent>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * <b>Example 3: </b> Associate a global element with XML Schema type
+ * to which the class is mapped.
+ * <pre>
+ *     //Example: Code fragment
+ *     &#64;XmlRootElement(name="PriceElement")
+ *     public class USPrice {
+ *         &#64;XmlElement
+ *         public java.math.BigDecimal price;
+ *     }
+ * {@code
+ * 
+ *     <!-- Example: XML schema definition -->
+ *     <xs:element name="PriceElement" type="USPrice"/>
+ *     <xs:complexType name="USPrice">
+ *       <xs:sequence>
+ *         <xs:element name="price" type="xs:decimal"/>
+ *       </sequence>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({TYPE})
+public @interface XmlRootElement {
+    /**
+     * namespace name of the XML element.
+     * <p>
+     * If the value is "##default", then the XML namespace name is derived
+     * from the package of the class ( {@link XmlSchema} ). If the
+     * package is unnamed, then the XML namespace is the default empty
+     * namespace.
+     */
+    String namespace() default "##default";
+
+    /**
+     * local name of the XML element.
+     * <p>
+     * If the value is "##default", then the name is derived from the
+     * class name. 
+     *
+     */
+    String name() default "##default";
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchema.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchema.java
new file mode 100644
index 0000000..e013dd6
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchema.java
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Maps a package name to a XML namespace. </p>
+ *
+ * <h3>Usage</h3>
+ * <p>
+ * The XmlSchema annotation can be used with the following program
+ * elements:
+ * <ul> 
+ *   <li>package</li>
+ * </ul>
+ *
+ * <p>
+ * This is a package level annotation and follows the recommendations
+ * and restrictions contained in JSR 175, section III, "Annotations".
+ * Thus the usage is subject to the following constraints and
+ * recommendations.
+ * <ul>
+ *   <li> There can only be one package declaration as noted in JSR
+ *        175, section III, "Annotations". </li>
+ *   <li> JSR 175 recommends package-info.java for package level
+ *        annotations. JAXB Providers that follow this recommendation
+ *        will allow the package level annotations to be defined in
+ *        package-info.java.
+ * </ul>
+ *
+ * <p><b>Example 1:</b> Customize name of XML namespace to which 
+ * package is mapped.</p>
+ *
+ * <pre>
+ *    &#64;javax.xml.bind.annotation.XmlSchema (
+ *      namespace = "http://www.example.com/MYPO1"
+ *    )
+ * {@code   
+ * 
+ *    <!-- XML Schema fragment -->
+ *    <schema
+ *      xmlns=...
+ *      xmlns:po=....
+ *      targetNamespace="http://www.example.com/MYPO1"
+ *    >
+ *    <!-- prefixes generated by default are implementation
+ *            depedenent -->
+ * }</pre>
+ *
+ * <p><b>Example 2:</b> Customize namespace prefix, namespace URI
+ * mapping</p>
+ *
+ * <pre>
+ *    // Package level annotation
+ *    &#64;javax.xml.bind.annotation.XmlSchema (
+ *      xmlns = { 
+ *        &#64;javax.xml.bind.annotation.XmlNs(prefix = "po", 
+ *                   namespaceURI="http://www.example.com/myPO1"),
+ *
+ *        &#64;javax.xml.bind.annotation.XmlNs(prefix="xs",
+ *                   namespaceURI="http://www.w3.org/2001/XMLSchema")
+ *      }
+ *    )
+ * {@code
+ * 
+ *    <!-- XML Schema fragment -->
+ *    <schema
+ *        xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ *        xmlns:po="http://www.example.com/PO1"
+ *        targetNamespace="http://www.example.com/PO1">
+ * 
+ * }</pre>
+ *
+ * <p><b>Example 3:</b> Customize elementFormDefault</p>
+ * <pre>
+ *    &#64;javax.xml.bind.annotation.XmlSchema (
+ *      elementFormDefault=XmlNsForm.UNQUALIFIED
+ *      ...
+ *    )
+ * {@code
+ * 
+ *    <!-- XML Schema fragment -->
+ *    <schema
+ *        xmlns="http://www.w3.org/2001/XMLSchema"
+ *        xmlns:po="http://www.example.com/PO1"
+ *        elementFormDefault="unqualified">
+ * 
+ * }</pre>
+
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target(PACKAGE)
+public @interface XmlSchema {
+
+    /**
+     * Customize the namespace URI, prefix associations. By default,
+     * the namespace prefixes for a XML namespace are generated by a
+     * JAXB Provider in an implementation dependent way.
+     */
+    XmlNs[]  xmlns() default {};
+
+    /**
+     * Name of the XML namespace.
+     */
+    String namespace() default "";
+
+    /**
+     * Namespace qualification for elements. By default, element 
+     * default attribute will be absent from the XML Schema fragment.
+     */
+    XmlNsForm elementFormDefault() default XmlNsForm.UNSET;
+
+    /**
+     * Namespace qualification for attributes. By default,
+     * attributesFormDefault will be absent from the XML Schema fragment.
+     */
+    XmlNsForm attributeFormDefault() default XmlNsForm.UNSET;
+
+    /**
+     * Indicates that this namespace (specified by {@link #namespace()})
+     * has a schema already available exeternally, available at this location.
+     *
+     * <p>
+     * This instructs the JAXB schema generators to simply refer to
+     * the pointed schema, as opposed to generating components into the schema.
+     * This schema is assumed to match what would be otherwise produced
+     * by the schema generator (same element names, same type names...)
+     *
+     * <p>
+     * This feature is intended to be used when a set of the Java classes
+     * is originally generated from an existing schema, hand-written to
+     * match externally defined schema, or the generated schema is modified
+     * manually.
+     *
+     * <p>
+     * Value could be any absolute URI, like {@code http://example.org/some.xsd}.
+     * It is also possible to specify the empty string, to indicate
+     * that the schema is externally available but the location is
+     * unspecified (and thus it's the responsibility of the reader of the generate
+     * schema to locate it.) Finally, the default value of this property
+     * {@code "##generate"} indicates that the schema generator is going
+     * to generate components for this namespace (as it did in JAXB 2.0.)
+     *
+     * <p>
+     * Multiple {@link XmlSchema} annotations on multiple packages are allowed
+     * to govern the same {@link #namespace()}. In such case, all of them
+     * must have the same {@link #location()} values.
+     *
+     *
+     * <h3>Note to implementor</h3>
+     * <p>
+     * More precisely, the value must be either {@code ""}, {@code "##generate"}, or
+     * <a href="http://www.w3.org/TR/xmlschema-2/#anyURI">
+     * a valid lexical representation of {@code xs:anyURI}</a> that begins
+     * with {@code <scheme>:}.
+     *
+     * <p>
+     * A schema generator is expected to generate a corresponding
+     * {@code <xs:import namespace="..." schemaLocation="..."/>} (or
+     * no {@code schemaLocation} attribute at all if the empty string is specified.)
+     * However, the schema generator is allowed to use a different value in
+     * the {@code schemaLocation} attribute (including not generating
+     * such attribute), for example so that the user can specify a local
+     * copy of the resource through the command line interface.
+     *
+     * @since 1.6, JAXB 2.1
+     */
+    String location() default NO_LOCATION;
+
+    /**
+     * The default value of the {@link #location()} attribute,
+     * which indicates that the schema generator will generate
+     * components in this namespace.
+     */
+    // the actual value is chosen because ## is not a valid
+    // sequence in xs:anyURI.
+    static final String NO_LOCATION = "##generate";
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
new file mode 100644
index 0000000..15040d7
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Maps a Java type to a simple schema built-in type.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * {@code @XmlSchemaType} annotation can be used with the following program
+ * elements: 
+ * <ul> 
+ *   <li> a JavaBean property </li>
+ *   <li> field </li>
+ *   <li> package</li>
+ * </ul>
+ *
+ * <p> {@code @XmlSchemaType} annotation defined for Java type
+ * applies to all references to the Java type from a property/field. 
+ * A {@code @XmlSchemaType} annotation specified on the
+ * property/field overrides the {@code @XmlSchemaType} annotation
+ * specified at the package level.
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlElement},  {@link XmlAttribute}.
+ * <p>
+ * <b>Example 1: </b> Customize mapping of XMLGregorianCalendar on the
+ *  field.
+ * 
+ * <pre>
+ *     //Example: Code fragment
+ *     public class USPrice {
+ *         &#64;XmlElement
+ *         &#64;XmlSchemaType(name="date")
+ *         public XMLGregorianCalendar date;
+ *     }
+ * {@code
+ * 
+ *     <!-- Example: Local XML Schema element -->
+ *     <xs:complexType name="USPrice"/>
+ *       <xs:sequence>
+ *         <xs:element name="date" type="xs:date"/>
+ *       </sequence>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * <p> <b> Example 2: </b> Customize mapping of XMLGregorianCalendar at package
+ *     level </p>
+ * <pre>
+ *     package foo;
+ *     &#64;javax.xml.bind.annotation.XmlSchemaType(
+ *          name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
+ *     }
+ * </pre>
+ * 
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE})        
+public @interface XmlSchemaType {
+    String name();
+    String namespace() default "http://www.w3.org/2001/XMLSchema";
+    /**
+     * If this annotation is used at the package level, then value of
+     * the type() must be specified.
+     */
+
+    Class type() default DEFAULT.class;
+
+    /**
+     * Used in {@link XmlSchemaType#type()} to
+     * signal that the type be inferred from the signature
+     * of the property.
+     */
+
+    static final class DEFAULT {}
+
+}
+
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
new file mode 100644
index 0000000..47f8cb7
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.PACKAGE;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlSchemaType} annotations.
+ *
+ * <p> Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple &#64;XmlSchemaType annotations as follows:
+ *
+ * <pre>
+ * &#64;XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })
+ * </pre>
+ * <p>The {@code @XmlSchemaTypes} annnotation can be used to
+ * define {@link XmlSchemaType} for different types at the
+ * package level.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlSchemaType
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlSchemaTypes {
+    /**
+     * Collection of @{@link XmlSchemaType} annotations
+     */
+    XmlSchemaType[] value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java
new file mode 100644
index 0000000..037ed49
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.JAXBContext;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Instructs JAXB to also bind other classes when binding this class.
+ *
+ * <p>
+ * Java makes it impractical/impossible to list all sub-classes of
+ * a given class. This often gets in a way of JAXB users, as it JAXB
+ * cannot automatically list up the classes that need to be known
+ * to {@link JAXBContext}.
+ *
+ * <p>
+ * For example, with the following class definitions:
+ *
+ * <pre>
+ * class Animal {}
+ * class Dog extends Animal {}
+ * class Cat extends Animal {}
+ * </pre>
+ *
+ * <p>
+ * The user would be required to create {@link JAXBContext} as
+ * {@code JAXBContext.newInstance(Dog.class,Cat.class)}
+ * ({@code Animal} will be automatically picked up since {@code Dog}
+ * and {@code Cat} refers to it.)
+ *
+ * <p>
+ * {@link XmlSeeAlso} annotation would allow you to write:
+ * <pre>
+ * &#64;XmlSeeAlso({Dog.class,Cat.class})
+ * class Animal {}
+ * class Dog extends Animal {}
+ * class Cat extends Animal {}
+ * </pre>
+ *
+ * <p>
+ * This would allow you to do {@code JAXBContext.newInstance(Animal.class)}.
+ * By the help of this annotation, JAXB implementations will be able to
+ * correctly bind {@code Dog} and {@code Cat}.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.1
+ */
+@Target({ElementType.TYPE})
+@Retention(RUNTIME)
+public @interface XmlSeeAlso {
+    Class[] value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlTransient.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlTransient.java
new file mode 100644
index 0000000..585e09c
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlTransient.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Prevents the mapping of a JavaBean property/type to XML representation.
+ * <p>
+ * The {@code @XmlTransient} annotation is useful for resolving name
+ * collisions between a JavaBean property name and a field name or
+ * preventing the mapping of a field/property. A name collision can
+ * occur when the decapitalized JavaBean property name and a field
+ * name are the same. If the JavaBean property refers to the field,
+ * then the name collision can be resolved by preventing the
+ * mapping of either the field or the JavaBean property using the
+ * {@code @XmlTransient} annotation.
+ *
+ * <p>
+ * When placed on a class, it indicates that the class shouldn't be mapped
+ * to XML by itself. Properties on such class will be mapped to XML along
+ * with its derived classes, as if the class is inlined.
+ *
+ * <p><b>Usage</b></p>
+ * <p> The {@code @XmlTransient} annotation can be used with the following
+ *     program elements: 
+ * <ul> 
+ *   <li> a JavaBean property </li>
+ *   <li> field </li>
+ *   <li> class </li>
+ * </ul>
+ *
+ * <p>{@code @XmlTransient} is mutually exclusive with all other
+ * JAXB defined annotations. </p>
+ * 
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example:</b> Resolve name collision between JavaBean property and
+ *     field name </p>
+ * 
+ * <pre>
+ *   // Example: Code fragment
+ *   public class USAddress {
+ *
+ *       // The field name "name" collides with the property name 
+ *       // obtained by bean decapitalization of getName() below
+ *       &#64;XmlTransient public String name;
+ *
+ *       String getName() {..};
+ *       String setName() {..};
+ *   }
+ *
+ * {@code   
+ * 
+ *   <!-- Example: XML Schema fragment -->
+ *   <xs:complexType name="USAddress">
+ *     <xs:sequence>
+ *       <xs:element name="name" type="xs:string"/>
+ *     </xs:sequence>
+ *   </xs:complexType>
+ * }</pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD, TYPE})
+public @interface XmlTransient {}
+   
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlType.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlType.java
new file mode 100644
index 0000000..284dc67
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlType.java
@@ -0,0 +1,443 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Maps a class or an enum type to a XML Schema type.
+ *
+ * <p><b>Usage</b></p>
+ * <p> The {@code @XmlType} annnotation can be used with the following program
+ * elements:
+ * <ul>
+ *   <li> a top level class </li>
+ *   <li> an enum type </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <h3> Mapping a Class </h3> 
+ * <p>
+ * A class maps to a XML Schema type. A class is a data container for
+ * values represented by properties and fields. A schema type is a
+ * data container for values represented by schema components within a
+ * schema type's content model (e.g. model groups, attributes etc).
+ * <p> To be mapped, a class must either have a public no-arg
+ * constructor or a static no-arg factory method. The static factory
+ * method can be specified in {@code factoryMethod()} and
+ * {@code factoryClass()} annotation elements. The static factory
+ * method or the no-arg constructor is used during unmarshalling to
+ * create an instance of this class. If both are present, the static
+ * factory method overrides the no-arg constructor.
+ * <p>
+ * A class maps to either a XML Schema complex type or a XML Schema simple
+ * type. The XML Schema type is derived based on the 
+ * mapping of JavaBean properties and fields contained within the
+ * class. The schema type to which the class is mapped can either be
+ * named or anonymous. A class can be mapped to an anonymous schema
+ * type by annotating the class with {@code @XmlType(name="")}.
+ * <p>
+ * Either a global element, local element or a local attribute can be
+ * associated with an anonymous type as follows:
+ * <ul>
+ *   <li><b>global element: </b> A global element of an anonymous
+ *      type can be derived by annotating the class with @{@link
+ *      XmlRootElement}. See Example 3 below. </li> 
+ *
+ *   <li><b>local element: </b> A JavaBean property that references
+ *      a class annotated with @XmlType(name="") and is mapped to the
+ *      element associated with the anonymous type. See Example 4
+ *      below.</li> 
+ *
+ *   <li><b>attribute: </b> A JavaBean property that references
+ *      a class annotated with @XmlType(name="") and is mapped to the
+ *      attribute associated with the anonymous type. See Example 5 below. </li>
+ * </ul>
+ * <b> Mapping to XML Schema Complex Type </b>
+ * <ul>
+ *   <li>If class is annotated with {@code @XmlType(name="") }, it
+ *   is mapped to an anonymous type otherwise, the class name maps
+ *   to a complex type name. The {@code XmlName()} annotation element
+ *   can be used to customize the name.</li>  
+ *
+ *   <li> Properties and fields that are mapped to elements are mapped to a
+ *   content model within a complex type. The annotation element
+ *   {@code propOrder()} can be used to customize the content model to be
+ *   {@code xs:all} or {@code xs:sequence}.  It is used for specifying
+ *   the order of XML elements in {@code xs:sequence}. </li>
+ *
+ *   <li> Properties and fields can be mapped to attributes within the
+ *        complex type.  </li>
+ *
+ *   <li> The targetnamespace of the XML Schema type can be customized
+ *        using the annotation element {@code namespace()}. </li>
+ * </ul>
+ *
+ * <p>
+ * <b> Mapping class to XML Schema simple type </b>
+ * <p>
+ * A class can be mapped to a XML Schema simple type using the
+ * {@code @XmlValue} annotation. For additional details and examples,
+ * see @{@link XmlValue} annotation type.
+ * <p>
+ * The following table shows the mapping of the class to a XML Schema
+ * complex type or simple type. The notational symbols used in the table are:
+ * <ul>
+ *   <li> {@literal ->}    : represents a mapping </li>
+ *   <li> [x]+  : one or more occurrences of x </li>
+ *   <li> [ {@code @XmlValue} property ]: JavaBean property annotated with
+ *         {@code @XmlValue}</li>
+ *   <li> X     : don't care
+ * </ul>
+ * <blockquote>
+ *   <table class="striped" summary="Mapping class to XML Schema simple type">
+ *     <thead>
+ *       <tr>
+ *         <th scope="col">Target</th>
+ *         <th scope="col">propOrder</th>
+ *         <th scope="col">ClassBody</th>
+ *         <th scope="col">ComplexType</th>
+ *         <th scope="col">SimpleType</th>
+ *       </tr>
+ *     </thead>
+ * 
+ *     <tbody>
+ *       <tr>
+ *         <td>Class</td>
+ *         <td>{}</td>
+ *         <th scope="row">[property]+ {@literal ->} elements</th>
+ *         <td>complexcontent<br>xs:all</td>
+ *         <td> </td>
+ *       </tr>
+ * 
+ *       <tr>
+ *         <td>Class</td>
+ *         <td>non empty</td>
+ *         <th scope="row">[property]+ {@literal ->} elements</th>
+ *         <td>complexcontent<br>xs:sequence</td>
+ *         <td> </td>
+ *       </tr>
+ * 
+ *       <tr>
+ *         <td>Class</td>
+ *         <td>X</td>
+ *         <th scope="row">no property {@literal ->} element</th>
+ *         <td>complexcontent<br>empty sequence</td>
+ *         <td> </td>
+ *       </tr>
+ * 
+ *       <tr>
+ *         <td>Class</td>
+ *         <td>X</td>
+ *         <th scope="row">1 [{@code @XmlValue} property] {@literal &&} <br> [property]+ {@literal ->} attributes</th>
+ *         <td>simplecontent</td>
+ *         <td> </td>
+ *       </tr>
+ * 
+ *       <tr>
+ *         <td>Class</td>
+ *         <td>X</td>
+ *         <th scope="row">1 [{@code @XmlValue} property] {@literal &&} <br> no properties {@literal ->} attribute</th>
+ *         <td> </td>
+ *         <td>simpletype</td>
+ *       </tr>
+ *     </tbody>
+ *   </table>
+ * </blockquote>
+ * 
+ * <h3> Mapping an enum type </h3>
+ * 
+ * An enum type maps to a XML schema simple type with enumeration
+ * facets. The following annotation elements are ignored since they
+ * are not meaningful: {@code propOrder()} , {@code factoryMethod()} ,
+ * {@code factoryClass()} .
+ *
+ *  <h3> Usage with other annotations </h3>
+ * <p> This annotation can be used with the following annotations: 
+ * {@link XmlRootElement}, {@link XmlAccessorOrder}, {@link XmlAccessorType},
+ * {@link XmlEnum}. However, {@link
+ * XmlAccessorOrder} and {@link XmlAccessorType} are ignored when this
+ * annotation is used on an enum type.
+ * 
+ * <p> <b> Example 1: </b> Map a class to a complex type with
+ *   xs:sequence with a customized ordering of JavaBean properties. 
+ * </p>
+ *
+ * <pre>
+ *   &#64;XmlType(propOrder={"street", "city" , "state", "zip", "name" })
+ *   public class USAddress {
+ *     String getName() {..};
+ *     void setName(String) {..};
+ * 
+ *     String getStreet() {..};
+ *     void setStreet(String) {..};
+ *
+ *     String getCity() {..}; 
+ *     void setCity(String) {..};
+ * 
+ *     String getState() {..};
+ *     void setState(String) {..};
+ *
+ *     java.math.BigDecimal getZip() {..};
+ *     void setZip(java.math.BigDecimal) {..};
+ *   }
+ * {@code
+ * 
+ *   <!-- XML Schema mapping for USAddress -->
+ *   <xs:complexType name="USAddress">
+ *     <xs:sequence>
+ *       <xs:element name="street" type="xs:string"/>
+ *       <xs:element name="city" type="xs:string"/>
+ *       <xs:element name="state" type="xs:string"/>
+ *       <xs:element name="zip" type="xs:decimal"/>
+ *       <xs:element name="name" type="xs:string"/>
+ *     </xs:all>
+ *   </xs:complexType>
+ * }</pre>
+ * <p> <b> Example 2: </b> Map a class to a complex type with
+ *     xs:all </p>
+ * <pre>
+ * &#64;XmlType(propOrder={})
+ * public class USAddress { ...}
+ * {@code
+ * 
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ *   <xs:all>
+ *     <xs:element name="name" type="xs:string"/>
+ *     <xs:element name="street" type="xs:string"/>
+ *     <xs:element name="city" type="xs:string"/>
+ *     <xs:element name="state" type="xs:string"/>
+ *     <xs:element name="zip" type="xs:decimal"/>
+ *   </xs:sequence>
+ * </xs:complexType>
+ *}</pre>
+ * <p> <b> Example 3: </b> Map a class to a global element with an
+ * anonymous type. 
+ * </p>
+ * <pre>
+ *   &#64;XmlRootElement
+ *   &#64;XmlType(name="")
+ *   public class USAddress { ...}
+ * {@code
+ * 
+ *   <!-- XML Schema mapping for USAddress -->
+ *   <xs:element name="USAddress">
+ *     <xs:complexType>
+ *       <xs:sequence>
+ *         <xs:element name="name" type="xs:string"/>
+ *         <xs:element name="street" type="xs:string"/>
+ *         <xs:element name="city" type="xs:string"/>
+ *         <xs:element name="state" type="xs:string"/>
+ *         <xs:element name="zip" type="xs:decimal"/>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ *   </xs:element>
+ * }</pre>
+ *
+ * <p> <b> Example 4: </b> Map a property to a local element with
+ * anonymous type.
+ * <pre>
+ *   //Example: Code fragment
+ *   public class Invoice {
+ *       USAddress addr;
+ *           ...
+ *       }
+ *
+ *   &#64;XmlType(name="")
+ *   public class USAddress { ... }
+ *   } 
+ * {@code
+ * 
+ *   <!-- XML Schema mapping for USAddress -->
+ *   <xs:complexType name="Invoice">
+ *     <xs:sequence>
+ *       <xs:element name="addr">
+ *         <xs:complexType>
+ *           <xs:element name="name", type="xs:string"/>
+ *           <xs:element name="city", type="xs:string"/>
+ *           <xs:element name="city" type="xs:string"/>
+ *           <xs:element name="state" type="xs:string"/>
+ *           <xs:element name="zip" type="xs:decimal"/>
+ *         </xs:complexType>
+ *       ...
+ *     </xs:sequence>
+ *   </xs:complexType>
+ * }</pre>
+ *
+ * <p> <b> Example 5: </b> Map a property to an attribute with
+ * anonymous type.
+ * 
+ * <pre>
+ *
+ *     //Example: Code fragment
+ *     public class Item {
+ *         public String name;
+ *         &#64;XmlAttribute 
+ *         public USPrice price;
+ *     }
+ *    
+ *     // map class to anonymous simple type. 
+ *     &#64;XmlType(name="")
+ *     public class USPrice { 
+ *         &#64;XmlValue
+ *         public java.math.BigDecimal price;
+ *     }
+ * {@code
+ * 
+ *     <!-- Example: XML Schema fragment -->
+ *     <xs:complexType name="Item">
+ *       <xs:sequence>
+ *         <xs:element name="name" type="xs:string"/>
+ *         <xs:attribute name="price">
+ *           <xs:simpleType>
+ *             <xs:restriction base="xs:decimal"/>
+ *           </xs:simpleType>
+ *         </xs:attribute>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ *  <p> <b> Example 6: </b> Define a factoryClass and factoryMethod
+ *
+ * <pre> 
+ *      &#64;XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
+ *      factoryMethod="getUSAddress")
+ *      public class USAddress {
+ *
+ *          private String city;
+ *          private String name;
+ *          private String state;
+ *          private String street;
+ *          private int    zip;
+ *
+ *      public USAddress(String name, String street, String city, 
+ *          String state, int zip) {
+ *          this.name = name;
+ *          this.street = street;
+ *          this.city = city;
+ *          this.state = state;
+ *          this.zip = zip;
+ *      }
+ *  }
+ *
+ *  public class USAddressFactory {
+ *      public static USAddress getUSAddress(){
+ *       return new USAddress("Mark Baker", "23 Elm St", 
+ *          "Dayton", "OH", 90952);
+ *  }
+ *
+ * </pre>
+ *
+ *  <p> <b> Example 7: </b> Define factoryMethod and use the default factoryClass
+ * 
+ * <pre>
+ *      &#64;XmlType(name="USAddressType", factoryMethod="getNewInstance")
+ *      public class USAddress {
+ *
+ *          private String city;
+ *          private String name;
+ *          private String state;
+ *          private String street;
+ *          private int    zip;
+ *
+ *          private USAddress() {}
+ *
+ *          public static USAddress getNewInstance(){
+ *              return new USAddress();
+ *          }
+ *      }
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlElement
+ * @see XmlAttribute
+ * @see XmlValue
+ * @see XmlSchema
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({TYPE})
+public @interface XmlType {
+    /**
+     * Name of the XML Schema type which the class is mapped.
+     */
+    String name() default "##default" ;
+ 
+    /**
+     * Specifies the order for XML Schema elements when class is
+     * mapped to a XML Schema complex type.
+     * 
+     * <p> Refer to the table for how the propOrder affects the
+     * mapping of class </p>
+     * 
+     * <p> The propOrder is a list of names of JavaBean properties in
+     *     the class. Each name in the list is the name of a Java
+     *     identifier of the JavaBean property. The order in which
+     *     JavaBean properties are listed is the order of XML Schema
+     *     elements to which the JavaBean properties are mapped. </p>
+     * <p> All of the JavaBean properties being mapped to XML Schema elements
+     *     must be listed. 
+     * <p> A JavaBean property or field listed in propOrder must not
+     *     be transient or annotated with {@code @XmlTransient}.
+     * <p> The default ordering of JavaBean properties is determined
+     *     by @{@link XmlAccessorOrder}. 
+     */
+    String[] propOrder() default {""};
+
+    /**
+     * Name of the target namespace of the XML Schema type. By
+     * default, this is the target namespace to which the package
+     * containing the class is mapped.
+     */
+    String namespace() default "##default" ;
+   
+    /**
+     * Class containing a no-arg factory method for creating an
+     * instance of this class. The default is this class.
+     * 
+     * <p>If {@code factoryClass} is DEFAULT.class and
+     * {@code factoryMethod} is "", then there is no static factory
+     * method.
+     * 
+     * <p>If {@code factoryClass} is DEFAULT.class and
+     * {@code factoryMethod} is not "", then 
+     * {@code factoryMethod} is the name of a static factory method
+     * in this class. 
+     *
+     * <p>If {@code factoryClass} is not DEFAULT.class, then
+     * {@code factoryMethod} must not be "" and must be the name of
+     * a static factory method specified in {@code factoryClass}.
+     */
+    Class factoryClass() default DEFAULT.class;
+
+    /**
+     * Used in {@link XmlType#factoryClass()} to
+     * signal that either factory mehod is not used or
+     * that it's in the class with this {@link XmlType} itself. 
+     */
+    static final class DEFAULT {}
+
+    /**
+     * Name of a no-arg factory method in the class specified in
+     * {@code factoryClass} factoryClass().
+     * 
+     */
+    String factoryMethod() default "";
+}
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlValue.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlValue.java
new file mode 100644
index 0000000..f1c0184
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/XmlValue.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Enables mapping a class to a  XML Schema complex type with a
+ * simpleContent or a XML Schema simple type. 
+ * </p>
+ *
+ * <p>
+ * <b> Usage: </b>
+ * <p>
+ * The {@code @XmlValue} annotation can be used with the following program
+ * elements: 
+ * <ul> 
+ *   <li> a JavaBean property.</li>
+ *   <li> non static, non transient field.</li>
+ * </ul>
+ * 
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following usage constraints:
+ * <ul>
+ *   <li>At most one field or property can be annotated with the
+ *       {@code @XmlValue} annotation. </li>
+ *
+ *   <li>{@code @XmlValue} can be used with the following
+ *   annotations: {@link XmlList}. However this is redundant since
+ *   {@link XmlList} maps a type to a simple schema type that derives by
+ *   list just as {@link XmlValue} would. </li>
+ *
+ *   <li>If the type of the field or property is a collection type,
+ *       then the collection item type must map to a simple schema
+ *       type.  </li>
+ * 
+ *   <li>If the type of the field or property is not a collection
+ *       type, then the type must map to a XML Schema simple type. </li>
+ *
+ * </ul>
+ * <p>
+ * If the annotated JavaBean property is the sole class member being
+ * mapped to XML Schema construct, then the class is mapped to a
+ * simple type. 
+ *
+ * If there are additional JavaBean properties (other than the
+ * JavaBean property annotated with {@code @XmlValue} annotation)
+ * that are mapped to XML attributes, then the class is mapped to a
+ * complex type with simpleContent.
+ * </p>
+ *
+ * <p> <b> Example 1: </b> Map a class to XML Schema simpleType</p>
+ *
+ *   <pre>
+ * 
+ *     // Example 1: Code fragment
+ *     public class USPrice {
+ *         &#64;XmlValue
+ *         public java.math.BigDecimal price;
+ *     }
+ * {@code
+ * 
+ *     <!-- Example 1: XML Schema fragment -->
+ *     <xs:simpleType name="USPrice">
+ *       <xs:restriction base="xs:decimal"/>
+ *     </xs:simpleType>
+ *
+ * }</pre>
+ * 
+ * <p><b> Example 2: </b> Map a class to XML Schema complexType with
+ *        with simpleContent.</p>
+ * 
+ *   <pre>
+ *
+ *   // Example 2: Code fragment
+ *   public class InternationalPrice {
+ *       &#64;XmlValue
+ *       public java.math.BigDecimal price;
+ * 
+ *       &#64;XmlAttribute
+ *       public String currency;
+ *   }
+ * {@code
+ * 
+ *   <!-- Example 2: XML Schema fragment -->
+ *   <xs:complexType name="InternationalPrice">
+ *     <xs:simpleContent>
+ *       <xs:extension base="xs:decimal">
+ *         <xs:attribute name="currency" type="xs:string"/>
+ *       </xs:extension>
+ *     </xs:simpleContent>
+ *   </xs:complexType>
+ *
+ * }</pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlType
+ * @since 1.6, JAXB 2.0
+ */
+
+@Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlValue {}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
new file mode 100644
index 0000000..6f284b7
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+
+
+/**
+ * Built-in {@link XmlAdapter} to handle {@code xs:token} and its derived types.
+ *
+ * <p>
+ * This adapter removes leading and trailing whitespaces, then truncate any
+ * sequence of tab, CR, LF, and SP by a single whitespace character ' '.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+public class CollapsedStringAdapter extends XmlAdapter<String,String> {
+    /**
+     * Removes leading and trailing whitespaces of the string
+     * given as the parameter, then truncate any
+     * sequence of tab, CR, LF, and SP by a single whitespace character ' '.
+     */
+    public String unmarshal(String text) {
+        if(text==null)  return null;        // be defensive
+
+        int len = text.length();
+
+        // most of the texts are already in the collapsed form.
+        // so look for the first whitespace in the hope that we will
+        // never see it.
+        int s=0;
+        while(s<len) {
+            if(isWhiteSpace(text.charAt(s)))
+                break;
+            s++;
+        }
+        if(s==len)
+            // the input happens to be already collapsed.
+            return text;
+
+        // we now know that the input contains spaces.
+        // let's sit down and do the collapsing normally.
+
+        StringBuilder result = new StringBuilder(len /*allocate enough size to avoid re-allocation*/ );
+
+        if(s!=0) {
+            for( int i=0; i<s; i++ )
+                result.append(text.charAt(i));
+            result.append(' ');
+        }
+
+        boolean inStripMode = true;
+        for (int i = s+1; i < len; i++) {
+            char ch = text.charAt(i);
+            boolean b = isWhiteSpace(ch);
+            if (inStripMode && b)
+                continue; // skip this character
+
+            inStripMode = b;
+            if (inStripMode)
+                result.append(' ');
+            else
+                result.append(ch);
+        }
+
+        // remove trailing whitespaces
+        len = result.length();
+        if (len > 0 && result.charAt(len - 1) == ' ')
+            result.setLength(len - 1);
+        // whitespaces are already collapsed,
+        // so all we have to do is to remove the last one character
+        // if it's a whitespace.
+
+        return result.toString();
+    }
+
+    /**
+     * No-op.
+     *
+     * Just return the same string given as the parameter.
+     */
+    public String marshal(String s) {
+        return s;
+    }
+
+
+    /** returns true if the specified char is a white space character. */
+    protected static boolean isWhiteSpace(char ch) {
+        // most of the characters are non-control characters.
+        // so check that first to quickly return false for most of the cases.
+        if( ch>0x20 )   return false;
+
+        // other than we have to do four comparisons.
+        return ch == 0x9 || ch == 0xA || ch == 0xD || ch == 0x20;
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
new file mode 100644
index 0000000..b6fc586
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.DatatypeConverter;
+
+/**
+ * {@link XmlAdapter} for {@code xs:hexBinary}.
+ *
+ * <p>
+ * This {@link XmlAdapter} binds {@code byte[]} to the hexBinary representation in XML.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since 1.6, JAXB 2.0
+ */
+public final class HexBinaryAdapter extends XmlAdapter<String,byte[]> {
+    public byte[] unmarshal(String s) {
+        if(s==null)     return null;
+        return DatatypeConverter.parseHexBinary(s);
+    }
+
+    public String marshal(byte[] bytes) {
+        if(bytes==null)     return null;
+        return DatatypeConverter.printHexBinary(bytes);
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
new file mode 100644
index 0000000..b79e77a
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+
+
+/**
+ * {@link XmlAdapter} to handle {@code xs:normalizedString}.
+ *
+ * <p>
+ * Replaces any tab, CR, and LF by a whitespace character ' ',
+ * as specified in <a href="http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace">the whitespace facet 'replace'</a>
+ *
+ * @author Kohsuke Kawaguchi, Martin Grebac
+ * @since 1.6, JAXB 2.0
+ */
+public final class NormalizedStringAdapter extends XmlAdapter<String,String> {
+    /**
+     * Replace any tab, CR, and LF by a whitespace character ' ',
+     * as specified in <a href="http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace">the whitespace facet 'replace'</a>
+     */
+    public String unmarshal(String text) {
+        if(text==null)      return null;    // be defensive
+
+        int i=text.length()-1;
+
+        // look for the first whitespace char.
+        while( i>=0 && !isWhiteSpaceExceptSpace(text.charAt(i)) )
+            i--;
+
+        if( i<0 )
+            // no such whitespace. replace(text)==text.
+            return text;
+
+        // we now know that we need to modify the text.
+        // allocate a char array to do it.
+        char[] buf = text.toCharArray();
+
+        buf[i--] = ' ';
+        for( ; i>=0; i-- )
+            if( isWhiteSpaceExceptSpace(buf[i]))
+                buf[i] = ' ';
+
+        return new String(buf);
+    }
+
+    /**
+     * No-op.
+     *
+     * Just return the same string given as the parameter.
+     */
+        public String marshal(String s) {
+            return s;
+        }
+
+
+    /**
+     * Returns true if the specified char is a white space character
+     * but not 0x20.
+     */
+    protected static boolean isWhiteSpaceExceptSpace(char ch) {
+        // most of the characters are non-control characters.
+        // so check that first to quickly return false for most of the cases.
+        if( ch>=0x20 )   return false;
+
+        // other than we have to do four comparisons.
+        return ch == 0x9 || ch == 0xA || ch == 0xD;
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
new file mode 100644
index 0000000..bf87571
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+/**
+ * Adapts a Java type for custom marshaling.
+ *
+ * <p> <b> Usage: </b> </p>
+ *
+ * <p>
+ * Some Java types do not map naturally to an XML representation, for
+ * example {@code HashMap} or other non JavaBean classes. Conversely,
+ * an XML representation may map to a Java type but an application may
+ * choose to access the XML representation using another Java
+ * type. For example, the schema to Java binding rules bind
+ * xs:DateTime by default to XmlGregorianCalendar. But an application
+ * may desire to bind xs:DateTime to a custom type,
+ * MyXmlGregorianCalendar, for example. In both cases, there is a
+ * mismatch between <i> bound type </i>, used by an application to
+ * access XML content and the <i> value type</i>, that is mapped to an
+ * XML representation.  
+ *
+ * <p>
+ * This abstract class defines methods for adapting a bound type to a value
+ * type or vice versa. The methods are invoked by the JAXB binding
+ * framework during marshaling and unmarshalling:
+ *
+ * <ul>
+ *   <li> <b> XmlAdapter.marshal(...): </b> During marshalling, JAXB
+ *        binding framework invokes XmlAdapter.marshal(..) to adapt a
+ *        bound type to value type, which is then marshaled to XML 
+ *        representation. </li> 
+ *
+ *   <li> <b> XmlAdapter.unmarshal(...): </b> During unmarshalling,
+ *        JAXB binding framework first unmarshals XML representation
+ *        to a value type and then invokes XmlAdapter.unmarshal(..) to
+ *        adapt the value type to a bound type. </li> 
+ * </ul>
+ *
+ * Writing an adapter therefore involves the following steps:
+ * 
+ * <ul>
+ *   <li> Write an adapter that implements this abstract class. </li>
+ *   <li> Install the adapter using the annotation {@link
+ *        XmlJavaTypeAdapter} </li>
+ * </ul>
+ *
+ * <p><b>Example:</b> Customized mapping of {@code HashMap}</p>
+ * <p> The following example illustrates the use of 
+ * {@code @XmlAdapter} and {@code @XmlJavaTypeAdapter} to
+ * customize the mapping of a {@code HashMap}.
+ *
+ * <p> <b> Step 1: </b> Determine the desired XML representation for HashMap.
+ *
+ * <pre>{@code
+ *     <hashmap>
+ *         <entry key="id123">this is a value</entry>
+ *         <entry key="id312">this is another value</entry>
+ *         ...
+ *     </hashmap>
+ * }</pre>
+ *
+ * <p> <b> Step 2: </b> Determine the schema definition that the
+ * desired XML representation shown above should follow.
+ *
+ * <pre>{@code
+ *     
+ *     <xs:complexType name="myHashMapType">
+ *       <xs:sequence>
+ *         <xs:element name="entry" type="myHashMapEntryType"
+ *                        minOccurs = "0" maxOccurs="unbounded"/>
+ *       </xs:sequence>
+ *     </xs:complexType>
+ *
+ *     <xs:complexType name="myHashMapEntryType">
+ *       <xs:simpleContent>
+ *         <xs:extension base="xs:string">
+ *           <xs:attribute name="key" type="xs:int"/>
+ *         </xs:extension>
+ *       </xs:simpleContent>
+ *     </xs:complexType>
+ *
+ * }</pre>
+ *
+ * <p> <b> Step 3: </b> Write value types that can generate the above
+ * schema definition.
+ *
+ * <pre>
+ *     public class MyHashMapType {
+ *         List&lt;MyHashMapEntryType&gt; entry;
+ *     }
+ *
+ *     public class MyHashMapEntryType {
+ *         &#64;XmlAttribute
+ *         public Integer key; 
+ *
+ *         &#64;XmlValue
+ *         public String value;
+ *     }
+ * </pre>
+ * 
+ * <p> <b> Step 4: </b> Write the adapter that adapts the value type,
+ * MyHashMapType to a bound type, HashMap, used by the application.
+ *
+ * <pre>{@code
+ *     public final class MyHashMapAdapter extends
+ *                        XmlAdapter<MyHashMapType,HashMap> { ... }
+ *      
+ * }</pre>
+ *
+ * <p> <b> Step 5: </b> Use the adapter.
+ *
+ * <pre>
+ *     public class Foo {
+ *         &#64;XmlJavaTypeAdapter(MyHashMapAdapter.class)
+ *         HashMap hashmap;
+ *         ...
+ *     }
+ * </pre>
+ *
+ * The above code fragment will map to the following schema:
+ * 
+ * <pre>{@code
+ *     <xs:complexType name="Foo">
+ *       <xs:sequence>
+ *         <xs:element name="hashmap" type="myHashMapType">
+ *       </xs:sequence>
+ *     </xs:complexType>
+ * }</pre>
+ *
+ * @param <BoundType>
+ *      The type that JAXB doesn't know how to handle. An adapter is written
+ *      to allow this type to be used as an in-memory representation through
+ *      the {@code ValueType}.
+ * @param <ValueType>
+ *      The type that JAXB knows how to handle out of the box.
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+ * @see XmlJavaTypeAdapter
+ * @since 1.6, JAXB 2.0
+ */
+public abstract class XmlAdapter<ValueType,BoundType> {
+
+    /**
+     * Do-nothing constructor for the derived classes.
+     */
+    protected XmlAdapter() {}
+
+    /**
+     * Convert a value type to a bound type.
+     *
+     * @param v
+     *      The value to be converted. Can be null.
+     * @throws Exception
+     *      if there's an error during the conversion. The caller is responsible for
+     *      reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
+     */
+    public abstract BoundType unmarshal(ValueType v) throws Exception;
+
+    /**
+     * Convert a bound type to a value type.
+     *
+     * @param v
+     *      The value to be convereted. Can be null.
+     * @throws Exception
+     *      if there's an error during the conversion. The caller is responsible for
+     *      reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
+     */
+    public abstract ValueType marshal(BoundType v) throws Exception;
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
new file mode 100644
index 0000000..e7cecd5
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElementRefs;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlSchemaTypes;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.PACKAGE;
+
+
+/**
+ * Use an adapter that implements {@link XmlAdapter} for custom marshaling.
+ *
+ * <p> <b> Usage: </b> </p>
+ *
+ * <p> The {@code @XmlJavaTypeAdapter} annotation can be used with the
+ * following program elements:  
+ * <ul> 
+ *   <li> a JavaBean property </li>
+ *   <li> field </li>
+ *   <li> parameter </li>
+ *   <li> package </li>
+ *   <li> from within {@link XmlJavaTypeAdapters} </li>
+ * </ul>
+ *
+ * <p> When {@code @XmlJavaTypeAdapter} annotation is defined on a
+ * class, it applies to all references to the class.
+ * <p> When {@code @XmlJavaTypeAdapter} annotation is defined at the
+ * package level it applies to all references from within the package
+ * to {@code @XmlJavaTypeAdapter.type()}.
+ * <p> When {@code @XmlJavaTypeAdapter} annotation is defined on the
+ * field, property or parameter, then the annotation applies to the
+ * field, property or the parameter only.
+ * <p> A {@code @XmlJavaTypeAdapter} annotation on a field, property
+ * or parameter overrides the {@code @XmlJavaTypeAdapter} annotation
+ * associated with the class being referenced by the field, property
+ * or parameter.  
+ * <p> A {@code @XmlJavaTypeAdapter} annotation on a class overrides
+ * the {@code @XmlJavaTypeAdapter} annotation specified at the
+ * package level for that class.
+ *
+ * <p>This annotation can be used with the following other annotations:
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlElementRef},
+ * {@link XmlElementRefs}, {@link XmlAnyElement}. This can also be
+ * used at the package level with the following annotations:
+ * {@link XmlAccessorType}, {@link XmlSchema}, {@link XmlSchemaType},
+ * {@link XmlSchemaTypes}. 
+ * 
+ * <p><b> Example: </b> See example in {@link XmlAdapter}
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+ * @since 1.6, JAXB 2.0
+ * @see XmlAdapter
+ */
+
+@Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})        
+public @interface XmlJavaTypeAdapter {
+    /**
+     * Points to the class that converts a value type to a bound type or vice versa.
+     * See {@link XmlAdapter} for more details.
+     */
+    Class<? extends XmlAdapter> value();
+
+    /**
+     * If this annotation is used at the package level, then value of
+     * the type() must be specified.
+     */
+
+    Class type() default DEFAULT.class;
+
+    /**
+     * Used in {@link XmlJavaTypeAdapter#type()} to
+     * signal that the type be inferred from the signature
+     * of the field, property, parameter or the class.
+     */
+
+    static final class DEFAULT {}
+    
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
new file mode 100644
index 0000000..8e2a068
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import static java.lang.annotation.ElementType.PACKAGE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlJavaTypeAdapter} annotations.
+ *
+ * <p> Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple &#64;XmlJavaTypeAdapter as follows:
+ *
+ * <pre>
+ * &#64;XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...),@XmlJavaTypeAdapter(...) })
+ * </pre>
+ *
+ * <p>The {@code @XmlJavaTypeAdapters} annotation is useful for
+ * defining {@link XmlJavaTypeAdapter} annotations for different types
+ * at the package level.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlJavaTypeAdapter
+ * @since 1.6, JAXB 2.0
+ */
+@Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlJavaTypeAdapters {
+    /**
+     * Collection of @{@link XmlJavaTypeAdapter} annotations
+     */
+    XmlJavaTypeAdapter[] value();
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/package-info.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/package-info.java
new file mode 100644
index 0000000..a6569f0
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/package-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined
+ * sub-classes to allow arbitrary Java classes to be used with JAXB.
+ * 
+ * <h2>Package Specification</h2>
+ * 
+ * <ul>
+ * <li><a href="http://jcp.org/en/jsr/detail?id=222">JAXB Specification</a>
+ * </ul>
+ * 
+ * <h2>Related Documentation</h2>
+ * 
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="http://jaxb.java.net">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="http://jaxb.java.net">JAXB Website</a>
+ */
+package javax.xml.bind.annotation.adapters;
diff --git a/jaxb-api/src/main/java/javax/xml/bind/annotation/package-info.java b/jaxb-api/src/main/java/javax/xml/bind/annotation/package-info.java
new file mode 100644
index 0000000..d1dba46
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/annotation/package-info.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * Defines annotations for customizing Java program elements to XML Schema mapping.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>The following table shows the JAXB mapping annotations
+ * that can be associated with each program element. </p>
+ * <p>
+ * <table class="striped" summary="Annotations for customizing Java program elements to XML Schema mapping">
+ *   <thead>
+ *     <tr>
+ *       <th scope="col">Program Element</th>
+ *       <th scope="col">JAXB annotation</th>
+ *     </tr>
+ *   </thead>
+ *   <tbody style="text-align:left">
+ *     <tr>
+ *       <th scope="row" style="vertical-align:top">Package</th>
+ *       <td>
+ *         <ul style="list-style-type:none">
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorType.html">XmlAccessorType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlSchema.html">XmlSchema</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlSchemaType.html">XmlSchemaType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlSchemaTypes.html">XmlSchemaTypes</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.html">XmlJavaTypeAdapters</a></li>
+ *         </ul>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row" style="vertical-align:top">Class</th>
+ *       <td>
+ *         <ul style="list-style-type:none">
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorType.html">XmlAccessorType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlInlineBinaryData.html">XmlInlineBinaryData</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlRootElement.html">XmlRootElement</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlType.html">XmlType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</a></li>
+ *         </ul>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row" style="vertical-align:top">Enum type</th>
+ *       <td>
+ *         <ul style="list-style-type:none">
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlEnum.html">XmlEnum</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlEnumValue.html">XmlEnumValue (enum constant only)</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlRootElement.html">XmlRootElement</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlType.html">XmlType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</a></li>
+ *         </ul>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row" style="vertical-align:top">JavaBean Property/field</th>
+ *       <td>
+ *         <ul style="list-style-type:none">
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlElement.html">XmlElement</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlElements.html">XmlElements</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlElementRef.html">XmlElementRef</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlElementRefs.html">XmlElementRefs</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlElementWrapper.html">XmlElementWrapper</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAnyElement.html">XmlAnyElement</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAttribute.html">XmlAttribute</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAnyAttribute.html">XmlAnyAttribute</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlTransient.html">XmlTransient</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlValue.html">XmlValue</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlID.html">XmlID</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlIDREF.html">XmlIDREF</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlMixed.html">XmlMixed</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlMimeType.html">XmlMimeType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html">XmlAttachmentRef</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlInlineBinaryData.html">XmlInlineBinaryData</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlElementDecl.html">XmlElementDecl (only on method)</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</a></li>
+ *         </ul>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row" style="vertical-align:top">Parameter</th>
+ *       <td>
+ *         <ul style="list-style-type:none">
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html">XmlAttachmentRef</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/XmlMimeType.html">XmlMimeType</a></li>
+ *             <li><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</a></li>
+ *         </ul>
+ *       </td>
+ *     </tr>
+ * </tbody>
+ * </table>
+ * <h3>Terminology</h3>
+ * <p>
+ * <b>JavaBean property and field:</b> For the purposes of
+ * mapping, there is no semantic difference between a field and
+ * a JavaBean property. Thus, an annotation that can be applied
+ * to a JavaBean property can always be applied to a
+ * field. Hence in the Javadoc documentation, for brevity, the
+ * term JavaBean property or property is used to mean either JavaBean
+ * property or a field. Where required, both are explicitly
+ * mentioned.
+ * <p>
+ * <b>top level class:</b> For the purpose of mapping, there is
+ * no semantic difference between a top level class and a
+ * static nested class. Thus, an annotation that can be applied
+ * to a top level class, can always be applied to a nested
+ * static class. Hence in the Javadoc documentation, for
+ * brevity, the term "top level class" or just class is used to
+ * mean either a top level class or a nested static
+ * class.
+ * <p>
+ * <b>mapping annotation:</b>A JAXB 2.0 defined program
+ * annotation based on the JSR 175 programming annotation
+ * facility.
+ * <h3>Common Usage Constraints</h3>
+ * <p>The following usage constraints are defined here since
+ * they apply to more than annotation:
+ * <ul>
+ * <li> For a property, a given annotation can be applied to
+ * either read or write property but not both. </li>
+ * <li> A property name must be different from any other
+ * property name in any of the super classes of the
+ * class being mapped. </li>
+ * <li> A mapped field name or the decapitalized name of a
+ * mapped property must be unique within a class. </li>
+ * </ul>
+ * <h3>Notations</h3>
+ * <b>Namespace prefixes</b>
+ * <p>The following namespace prefixes are used in the XML Schema
+ * fragments in this package.
+ * <p>
+ * <table class="striped" summary="XML Schema fragments namespace prefixes">
+ *   <thead>
+ *     <tr>
+ *       <th scope="col">Prefix</th>
+ *       <th scope="col">Namespace</th>
+ *       <th scope="col">Notes</th>
+ *     </tr>
+ *   </thead>
+ *   <tbody>
+ *     <tr>
+ *       <th scope="row">xs</th>
+ *       <td>http://www.w3.org/2001/XMLSchema</td>
+ *       <td>Namespace of XML Schema namespace</td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row">ref</th>
+ *       <td>http://ws-i.org/profiles/basic/1.1/xsd</td>
+ *       <td>Namespace for swaref schema component</td>
+ *     </tr>
+ *     <tr>
+ *       <th scope="row">xsi</th>
+ *       <td>http://www.w3.org/2001/XMLSchema-instance</td>
+ *       <td>XML Schema namespace for instances</td>
+ *     </tr>
+ *   </tbody>
+ * </table>
+ *
+ * @since 1.6, JAXB 2.0
+ */
+package javax.xml.bind.annotation;
diff --git a/jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java b/jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
new file mode 100644
index 0000000..c3e81e6
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.attachment;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.Marshaller;
+
+/**
+ * <p>Enable JAXB marshalling to optimize storage of binary data.
+ *
+ * <p>This API enables an efficient cooperative creation of optimized
+ * binary data formats between a JAXB marshalling process and a MIME-based package
+ * processor. A JAXB implementation marshals the root body of a MIME-based package,
+ * delegating the creation of referenceable MIME parts to
+ * the MIME-based package processor that implements this abstraction.
+ *
+ * <p>XOP processing is enabled when {@link #isXOPPackage()} is true.
+ *    See {@link #addMtomAttachment(DataHandler, String, String)} for details.
+ *
+ *
+ * <p>WS-I Attachment Profile 1.0 is supported by
+ * {@link #addSwaRefAttachment(DataHandler)} being called by the
+ * marshaller for each JAXB property related to
+ * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef.
+ *
+ *
+ * @author Marc Hadley
+ * @author Kohsuke Kawaguchi
+ * @author Joseph Fialli
+ * @since 1.6, JAXB 2.0
+ *
+ * @see Marshaller#setAttachmentMarshaller(AttachmentMarshaller)
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+ */
+public abstract class AttachmentMarshaller {
+
+    /**
+     * <p>Consider MIME content {@code data} for optimized binary storage as an attachment.
+     *
+     * <p>
+     * This method is called by JAXB marshal process when {@link #isXOPPackage()} is
+     * {@code true}, for each element whose datatype is "base64Binary", as described in
+     * Step 3 in
+     * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Packages</a>.
+     *
+     * <p>
+     * The method implementor determines whether {@code data} shall be attached separately
+     * or inlined as base64Binary data. If the implementation chooses to optimize the storage
+     * of the binary data as a MIME part, it is responsible for attaching {@code data} to the
+     * MIME-based package, and then assigning an unique content-id, cid, that identifies
+     * the MIME part within the MIME message. This method returns the cid,
+     * which enables the JAXB marshaller to marshal a XOP element that refers to that cid in place
+     * of marshalling the binary data. When the method returns null, the JAXB marshaller
+     * inlines {@code data} as base64binary data.
+     *
+     * <p>
+     * The caller of this method is required to meet the following constraint.
+     * If the element infoset item containing {@code data} has the attribute
+     * {@code xmime:contentType} or if the JAXB property/field representing
+     * {@code data} is annotated with a known MIME type,
+     * {@code data.getContentType()} should be set to that MIME type.
+     *
+     * <p>
+     * The {@code elementNamespace} and {@code elementLocalName}
+     * parameters provide the
+     * context that contains the binary data. This information could
+     * be used by the MIME-based package processor to determine if the
+     * binary data should be inlined or optimized as an attachment.
+     *
+     * @param data
+     *       represents the data to be attached. Must be non-null.
+     * @param elementNamespace
+     *      the namespace URI of the element that encloses the base64Binary data.
+     *      Can be empty but never null.
+     * @param elementLocalName
+     *      The local name of the element. Always a non-null valid string.
+     *
+     * @return
+     *     a valid content-id URI (see <a href="http://www.w3.org/TR/xop10/#RFC2387">RFC 2387</a>) that identifies the attachment containing {@code data}.
+     *     Otherwise, null if the attachment was not added and should instead be inlined in the message.
+     *
+     * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+     * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+     */
+    public abstract String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName);
+
+    /**
+     * <p>Consider binary {@code data} for optimized binary storage as an attachment.
+     *
+     * <p>Since content type is not known, the attachment's MIME content type must be set to "application/octet-stream".
+     *
+     * <p>
+     * The {@code elementNamespace} and {@code elementLocalName}
+     * parameters provide the
+     * context that contains the binary data. This information could
+     * be used by the MIME-based package processor to determine if the
+     * binary data should be inlined or optimized as an attachment.
+     *
+     * @param data
+     *      represents the data to be attached. Must be non-null. The actual data region is
+     *      specified by {@code (data,offset,length)} tuple.
+     *
+     * @param offset
+     *       The offset within the array of the first byte to be read;
+     *       must be non-negative and no larger than array.length
+     *
+     * @param length
+     *       The number of bytes to be read from the given array;
+     *       must be non-negative and no larger than array.length
+     *
+     * @param mimeType
+     *      If the data has an associated MIME type known to JAXB, that is passed
+     *      as this parameter. If none is known, "application/octet-stream".
+     *      This parameter may never be null.
+     *
+     * @param elementNamespace
+     *      the namespace URI of the element that encloses the base64Binary data.
+     *      Can be empty but never null.
+     *
+     * @param elementLocalName
+     *      The local name of the element. Always a non-null valid string.
+     *
+     * @return content-id URI, cid, to the attachment containing
+     *         {@code data} or null if data should be inlined.
+     *
+     * @see #addMtomAttachment(DataHandler, String, String)
+     */
+    public abstract String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName);
+
+    /**
+     * <p>Read-only property that returns true if JAXB marshaller should enable XOP creation.
+     *
+     * <p>This value must not change during the marshalling process. When this
+     * value is true, the {@code addMtomAttachment(...)} method
+     * is invoked when the appropriate binary datatypes are encountered by
+     * the marshal process.
+     *
+     * <p>Marshaller.marshal() must throw IllegalStateException if this value is {@code true}
+     * and the XML content to be marshalled violates Step 1 in
+     * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>
+     * http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages.
+     * <i>"Ensure the Original XML Infoset contains no element information item with a
+     * [namespace name] of "http://www.w3.org/2004/08/xop/include" and a [local name] of Include"</i>
+     *
+     * <p>When this method returns true and during the marshal process
+     * at least one call to {@code addMtomAttachment(...)} returns
+     * a content-id, the MIME-based package processor must label the
+     * root part with the application/xop+xml media type as described in
+     * Step 5 of
+     * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>.
+     *
+     * @return true when MIME context is a XOP Package.
+     */
+    public boolean isXOPPackage() { return false; }
+
+   /**
+    * <p>Add MIME {@code data} as an attachment and return attachment's content-id, cid.
+    *
+    * <p>
+    * This method is called by JAXB marshal process for each element/attribute typed as
+    * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The MIME-based package processor
+    * implementing this method is responsible for attaching the specified data to a
+    * MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment
+    * within the MIME-based package.
+    *
+    * <p>Caller inserts the returned content-id, cid, into the XML content being marshalled.
+    *
+    * @param data
+    *       represents the data to be attached. Must be non-null.
+    * @return
+    *       must be a valid URI used as cid. Must satisfy Conformance Requirement R2928 from
+    *       <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+    */
+    public abstract String addSwaRefAttachment(DataHandler data);
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
new file mode 100644
index 0000000..71e507b
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.attachment;
+
+import javax.activation.DataHandler;
+
+/**
+ * <p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p>
+ *
+ * <p>This API enables an efficient cooperative processing of optimized
+ * binary data formats between a JAXB 2.0 implementation and MIME-based package
+ * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the 
+ * understanding of the packaging format being used to a MIME-based 
+ * package processor that implements this abstract class.</p>
+ *
+ * <p>This abstract class identifies if a package requires XOP processing, {@link #isXOPPackage()}
+ * and provides retrieval of binary content stored as attachments by content-id.</p>
+ *
+ * <h2>Identifying the content-id, cid, to pass to {@code getAttachment*(String cid)}</h2>
+ * <ul>
+ * <li>
+ * For XOP processing, the infoset representation of the cid is described 
+ * in step 2a in 
+ * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
+ * </li>
+ * <li>
+ * For WS-I AP 1.0, the cid is identified as an element or attribute of 
+ * type {@code ref:swaRef} specified in
+ * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">
+ * Section 4.4 Referencing Attachments from the SOAP Envelope</a>
+ * </li>
+ * </ul>
+ * 
+ * @author Marc Hadley
+ * @author Kohsuke Kawaguchi
+ * @author Joseph Fialli
+ * 
+ * @since 1.6, JAXB 2.0
+ * 
+ * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller)
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+ * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+ */
+public abstract class AttachmentUnmarshaller {
+   /**
+    * <p>Lookup MIME content by content-id, {@code cid}, and return as a {@link DataHandler}.</p>
+    * 
+    * <p>The returned {@code DataHandler} instance must be configured
+    * to meet the following required mapping constaint. 
+    * <table class="striped">
+    *   <caption>Required Mappings between MIME and Java Types</caption>
+    *   <thead>
+    *     <tr>
+    *       <th scope="col">MIME Type</th>
+    *       <th scope="col">Java Type</th>
+    *       </tr>
+    *     <tr>
+    *       <th scope="col">{@code DataHandler.getContentType()}</th>
+    *       <th scope="col">{@code instanceof DataHandler.getContent()}</th>
+    *     </tr>
+    *   </thead>
+    *   <tbody style="text-align:left">
+    *     <tr>
+    *       <th scope="row">image/gif</th>
+    *       <td>java.awt.Image</td>
+    *     </tr>
+    *     <tr>
+    *       <th scope="row">image/jpeg</th>
+    *       <td>java.awt.Image</td>
+    *     </tr>
+    *     <tr>
+    *       <th scope="row">text/xml  or application/xml</th>
+    *       <td>javax.xml.transform.Source</td>
+    *     </tr>
+    *   </tbody>
+    *  </table>
+    * Note that it is allowable to support additional mappings.
+    * 
+    * @param cid It is expected to be a valid lexical form of the XML Schema 
+    * {@code xs:anyURI} datatype. If {@link #isXOPPackage()}{@code ==true},
+    * it must be a valid URI per the {@code cid:} URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+    * 
+    * @return
+    *       a {@link DataHandler} that represents the MIME attachment.
+    *
+    * @throws IllegalArgumentException if the attachment for the given cid is not found.
+    */
+   public abstract DataHandler getAttachmentAsDataHandler(String cid);
+
+    /**
+     * <p>Retrieve the attachment identified by content-id, {@code cid}, as a {@code byte[]}.
+     *
+     * @param cid It is expected to be a valid lexical form of the XML Schema 
+     * {@code xs:anyURI} datatype. If {@link #isXOPPackage()}{@code ==true},
+     * it must be a valid URI per the {@code cid:} URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+     *
+     * @return byte[] representation of attachment identified by cid.
+     * 
+    * @throws IllegalArgumentException if the attachment for the given cid is not found.
+     */
+    public abstract byte[] getAttachmentAsByteArray(String cid);
+
+    /**
+     * <p>Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</p>
+     *
+     * <p>This method returns {@code true} when the constraints specified
+     * in  <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#identifying_xop_documents">Identifying XOP Documents</a> are met.
+     * This value must not change during the unmarshalling process.</p>
+     *
+     * @return true when MIME context is a XOP Document.
+     */
+    public boolean isXOPPackage() { return false; } 
+}
+
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/attachment/package-info.java b/jaxb-api/src/main/java/javax/xml/bind/attachment/package-info.java
new file mode 100644
index 0000000..8882414
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/attachment/package-info.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * This package is implemented by a MIME-based package processor that
+ * enables the interpretation and creation of optimized binary data
+ * within an MIME-based package format.
+ * <p>
+ * <p>
+ * Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to
+ * optimized transmission of binary datatypes as an attachment.
+ * To optimally support these standards within a message passing
+ * environment, this package enables an integrated solution between
+ * a MIME-based package processor and JAXB unmarshall/marshal processes.
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Standards</h2>
+ * <p>
+ * <ul>
+ * <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li>
+ * <li><a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li>
+ * <li><a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">[3]WS-I Attachments Profile Version 1.0.</a></li>
+ * <li><a href="http://www.w3.org/TR/xml-media-types/">[4]Describing Media Content of Binary Data in XML</a></li>
+ * </ul>
+ *
+ * @see <a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a>
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">[3]WS-I Attachments Profile Version 1.0.</a>
+ * @see <a href="http://www.w3.org/TR/xml-media-types/">[4]Describing Media Content of Binary Data in XML</a>
+ * @since JAXB 2.0
+ */
+package javax.xml.bind.attachment;
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
new file mode 100644
index 0000000..80c78ee
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.PropertyException;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.validation.Schema;
+import java.io.UnsupportedEncodingException;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.FileOutputStream;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+// J2SE1.4 feature
+// import java.nio.charset.Charset;
+// import java.nio.charset.UnsupportedCharsetException;
+
+/**
+ * Partial default {@code Marshaller} implementation.
+ * 
+ * <p>
+ * This class provides a partial default implementation for the
+ * {@link javax.xml.bind.Marshaller} interface.
+ * 
+ * <p>
+ * The only methods that a JAXB Provider has to implement are
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.transform.Result)},
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLStreamWriter)}, and
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @see javax.xml.bind.Marshaller
+ * @since 1.6, JAXB 1.0
+ */
+public abstract class AbstractMarshallerImpl implements Marshaller
+{
+    /** handler that will be used to process errors and warnings during marshal */
+    private ValidationEventHandler eventHandler = 
+        new DefaultValidationEventHandler();
+    
+    //J2SE1.4 feature
+    //private Charset encoding = null;
+    
+    /** store the value of the encoding property. */
+    private String encoding = "UTF-8";
+    
+    /** store the value of the schemaLocation property. */
+    private String schemaLocation = null;
+
+    /** store the value of the noNamespaceSchemaLocation property. */
+    private String noNSSchemaLocation = null;
+    
+    /** store the value of the formattedOutput property. */
+    private boolean formattedOutput = false;
+
+    /** store the value of the fragment property. */
+    private boolean fragment = false;
+
+    public final void marshal( Object obj, java.io.OutputStream os )
+        throws JAXBException {
+            
+        checkNotNull( obj, "obj", os, "os" );
+        marshal( obj, new StreamResult(os) );
+    }
+
+    public void marshal(Object jaxbElement, File output) throws JAXBException {
+        checkNotNull(jaxbElement, "jaxbElement", output, "output" );
+        try {
+            OutputStream os = new BufferedOutputStream(new FileOutputStream(output));
+            try {
+                marshal( jaxbElement, new StreamResult(os) );
+            } finally {
+                os.close();
+            }
+        } catch (IOException e) {
+            throw new JAXBException(e);
+        }
+    }
+
+    public final void marshal( Object obj, java.io.Writer w ) 
+        throws JAXBException {
+            
+        checkNotNull( obj, "obj", w, "writer" );
+        marshal( obj, new StreamResult(w) );
+    }
+    
+    public final void marshal( Object obj, org.xml.sax.ContentHandler handler ) 
+        throws JAXBException {
+            
+        checkNotNull( obj, "obj", handler, "handler" );
+        marshal( obj, new SAXResult(handler) );
+    }
+    
+    public final void marshal( Object obj, org.w3c.dom.Node node ) 
+        throws JAXBException {
+            
+        checkNotNull( obj, "obj", node, "node" );
+        marshal( obj, new DOMResult(node) );
+    }
+    
+    /**
+     * By default, the getNode method is unsupported and throw
+     * an {@link java.lang.UnsupportedOperationException}.
+     * 
+     * Implementations that choose to support this method must
+     * override this method.
+     */
+    public org.w3c.dom.Node getNode( Object obj ) throws JAXBException {
+        
+        checkNotNull( obj, "obj", Boolean.TRUE, "foo" );
+        
+        throw new UnsupportedOperationException();
+    }
+    
+    /**
+     * Convenience method for getting the current output encoding.
+     * 
+     * @return the current encoding or "UTF-8" if it hasn't been set.
+     */
+    protected String getEncoding() {
+        return encoding;
+    }
+    
+    /**
+     * Convenience method for setting the output encoding.
+     * 
+     * @param encoding a valid encoding as specified in the Marshaller class 
+     * documentation
+     */
+    protected void setEncoding( String encoding ) {
+        this.encoding = encoding;
+    }
+    
+    /**
+     * Convenience method for getting the current schemaLocation.
+     * 
+     * @return the current schemaLocation or null if it hasn't been set
+     */
+    protected String getSchemaLocation() {
+        return schemaLocation;
+    }
+    
+    /**
+     * Convenience method for setting the schemaLocation.
+     * 
+     * @param location the schemaLocation value
+     */
+    protected void setSchemaLocation( String location ) {
+        schemaLocation = location;
+    }
+    
+    /**
+     * Convenience method for getting the current noNamespaceSchemaLocation.
+     * 
+     * @return the current noNamespaceSchemaLocation or null if it hasn't
+     * been set
+     */
+    protected String getNoNSSchemaLocation() {
+        return noNSSchemaLocation;
+    }
+    
+    /**
+     * Convenience method for setting the noNamespaceSchemaLocation.
+     * 
+     * @param location the noNamespaceSchemaLocation value
+     */
+    protected void setNoNSSchemaLocation( String location ) {
+        noNSSchemaLocation = location;
+    }
+    
+    /**
+     * Convenience method for getting the formatted output flag.
+     * 
+     * @return the current value of the formatted output flag or false if
+     * it hasn't been set.
+     */
+    protected boolean isFormattedOutput() {
+        return formattedOutput;
+    }
+    
+    /**
+     * Convenience method for setting the formatted output flag.
+     * 
+     * @param v value of the formatted output flag.
+     */
+    protected void setFormattedOutput( boolean v ) {
+        formattedOutput = v;
+    }
+    
+    
+    /**
+     * Convenience method for getting the fragment flag.
+     *
+     * @return the current value of the fragment flag or false if
+     * it hasn't been set.
+     */
+    protected boolean isFragment() {
+        return fragment;
+    }
+
+    /**
+     * Convenience method for setting the fragment flag.
+     *
+     * @param v value of the fragment flag.
+     */
+    protected void setFragment( boolean v ) {
+        fragment = v;
+    }
+
+
+    static String[] aliases = {
+        "UTF-8", "UTF8",
+        "UTF-16", "Unicode",
+        "UTF-16BE", "UnicodeBigUnmarked",
+        "UTF-16LE", "UnicodeLittleUnmarked",
+        "US-ASCII", "ASCII",
+        "TIS-620", "TIS620",
+        
+        // taken from the project-X parser
+        "ISO-10646-UCS-2", "Unicode",
+    
+        "EBCDIC-CP-US", "cp037",
+        "EBCDIC-CP-CA", "cp037",
+        "EBCDIC-CP-NL", "cp037",
+        "EBCDIC-CP-WT", "cp037",
+    
+        "EBCDIC-CP-DK", "cp277",
+        "EBCDIC-CP-NO", "cp277",
+        "EBCDIC-CP-FI", "cp278",
+        "EBCDIC-CP-SE", "cp278",
+    
+        "EBCDIC-CP-IT", "cp280",
+        "EBCDIC-CP-ES", "cp284",
+        "EBCDIC-CP-GB", "cp285",
+        "EBCDIC-CP-FR", "cp297",
+    
+        "EBCDIC-CP-AR1", "cp420",
+        "EBCDIC-CP-HE", "cp424",
+        "EBCDIC-CP-BE", "cp500",
+        "EBCDIC-CP-CH", "cp500",
+    
+        "EBCDIC-CP-ROECE", "cp870",
+        "EBCDIC-CP-YU", "cp870",
+        "EBCDIC-CP-IS", "cp871",
+        "EBCDIC-CP-AR2", "cp918",
+        
+        // IANA also defines two that JDK 1.2 doesn't handle:
+        //  EBCDIC-CP-GR        --> CP423
+        //  EBCDIC-CP-TR        --> CP905
+    };
+    
+    /**
+     * Gets the corresponding Java encoding name from an IANA name.
+     * 
+     * This method is a helper method for the derived class to convert
+     * encoding names.
+     * 
+     * @exception UnsupportedEncodingException
+     *      If this implementation couldn't find the Java encoding name.
+     */
+    protected String getJavaEncoding( String encoding ) throws UnsupportedEncodingException {
+        try {
+            "1".getBytes(encoding);
+            return encoding;
+        } catch( UnsupportedEncodingException e ) {
+            // try known alias
+            for( int i=0; i<aliases.length; i+=2 ) {
+                if(encoding.equals(aliases[i])) {
+                    "1".getBytes(aliases[i+1]);
+                    return aliases[i+1];
+                }
+            }
+            
+            throw new UnsupportedEncodingException(encoding);
+        }
+        /* J2SE1.4 feature
+        try {
+            this.encoding = Charset.forName( _encoding );
+        } catch( UnsupportedCharsetException uce ) {
+            throw new JAXBException( uce );
+        }
+         */
+    }
+    
+    /**
+     * Default implementation of the setProperty method handles
+     * the four defined properties in Marshaller. If a provider 
+     * needs to handle additional properties, it should override 
+     * this method in a derived class.
+     */
+    public void setProperty( String name, Object value )
+        throws PropertyException {
+        
+        if( name == null ) {
+            throw new IllegalArgumentException( 
+                Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+        }
+        
+        // recognize and handle four pre-defined properties.
+        if( JAXB_ENCODING.equals(name) ) {
+            checkString( name, value );
+            setEncoding( (String)value );
+            return;
+        }
+        if( JAXB_FORMATTED_OUTPUT.equals(name) ) {
+            checkBoolean( name, value );                    
+            setFormattedOutput((Boolean) value );
+            return;
+        }
+        if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) ) {
+            checkString( name, value );
+            setNoNSSchemaLocation( (String)value );
+            return;
+        }
+        if( JAXB_SCHEMA_LOCATION.equals(name) ) {
+            checkString( name, value );
+            setSchemaLocation( (String)value );
+            return;
+        }
+        if( JAXB_FRAGMENT.equals(name) )  {
+            checkBoolean(name, value);
+            setFragment((Boolean) value );
+            return;
+        }
+
+        throw new PropertyException(name, value);
+    }
+
+    /**
+     * Default implementation of the getProperty method handles
+     * the four defined properties in Marshaller.  If a provider 
+     * needs to support additional provider specific properties, 
+     * it should override this method in a derived class.
+     */
+    public Object getProperty( String name )
+        throws PropertyException {
+            
+        if( name == null ) {
+            throw new IllegalArgumentException( 
+                Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+        }
+        
+        // recognize and handle four pre-defined properties.
+        if( JAXB_ENCODING.equals(name) )
+            return getEncoding();
+        if( JAXB_FORMATTED_OUTPUT.equals(name) )
+            return isFormattedOutput()?Boolean.TRUE:Boolean.FALSE;
+        if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) )
+            return getNoNSSchemaLocation();
+        if( JAXB_SCHEMA_LOCATION.equals(name) )
+            return getSchemaLocation();
+        if( JAXB_FRAGMENT.equals(name) )
+            return isFragment()?Boolean.TRUE:Boolean.FALSE;
+
+        throw new PropertyException(name);
+    }
+    /**
+     * @see javax.xml.bind.Marshaller#getEventHandler()
+     */
+    public ValidationEventHandler getEventHandler() throws JAXBException {
+        return eventHandler;
+    }
+
+    /**
+     * @see javax.xml.bind.Marshaller#setEventHandler(ValidationEventHandler)
+     */
+    public void setEventHandler(ValidationEventHandler handler)
+        throws JAXBException {
+        
+        if( handler == null ) {
+            eventHandler = new DefaultValidationEventHandler();
+        } else {
+            eventHandler = handler;
+        }
+    }
+
+
+
+
+    /*
+     * assert that the given object is a Boolean
+     */
+    private void checkBoolean( String name, Object value ) throws PropertyException {
+        if(!(value instanceof Boolean))
+            throw new PropertyException(
+                Messages.format( Messages.MUST_BE_BOOLEAN, name ) );
+    }
+    
+    /*
+     * assert that the given object is a String
+     */
+    private void checkString( String name, Object value ) throws PropertyException {
+        if(!(value instanceof String))
+            throw new PropertyException(
+                Messages.format( Messages.MUST_BE_STRING, name ) );
+    }
+    
+    /*
+     * assert that the parameters are not null
+     */
+    private void checkNotNull( Object o1, String o1Name,
+                               Object o2, String o2Name ) {
+    
+        if( o1 == null ) {
+            throw new IllegalArgumentException( 
+                Messages.format( Messages.MUST_NOT_BE_NULL, o1Name ) );
+        }
+        if( o2 == null ) {
+            throw new IllegalArgumentException( 
+                Messages.format( Messages.MUST_NOT_BE_NULL, o2Name ) );
+        }
+    }
+
+    public void marshal(Object obj, XMLEventWriter writer)
+        throws JAXBException {
+        
+        throw new UnsupportedOperationException();
+    }
+
+    public void marshal(Object obj, XMLStreamWriter writer)
+        throws JAXBException {
+        
+        throw new UnsupportedOperationException();
+    }
+
+    public void setSchema(Schema schema) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Schema getSchema() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAdapter(XmlAdapter adapter) {
+        if(adapter==null)
+            throw new IllegalArgumentException();
+        setAdapter((Class)adapter.getClass(),adapter);
+    }
+
+    public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
+        throw new UnsupportedOperationException();
+    }
+
+    public <A extends XmlAdapter> A getAdapter(Class<A> type) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAttachmentMarshaller(AttachmentMarshaller am) {
+        throw new UnsupportedOperationException();
+    }
+
+    public AttachmentMarshaller getAttachmentMarshaller() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setListener(Listener listener) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Listener getListener() {
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
new file mode 100644
index 0000000..ef16017
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
@@ -0,0 +1,410 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.PropertyException;
+import javax.xml.bind.UnmarshalException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import java.io.*;
+import java.net.URL;
+
+/**
+ * Partial default {@code Unmarshaller} implementation.
+ * 
+ * <p>
+ * This class provides a partial default implementation for the
+ * {@link javax.xml.bind.Unmarshaller}interface.
+ * 
+ * <p>
+ * A JAXB Provider has to implement five methods (getUnmarshallerHandler,
+ * unmarshal(Node), unmarshal(XMLReader,InputSource),
+ * unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).
+ * 
+ * @author <ul>
+ *         <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ *         </ul>
+ * @see javax.xml.bind.Unmarshaller
+ * @since 1.6, JAXB 1.0
+ */
+public abstract class AbstractUnmarshallerImpl implements Unmarshaller
+{    
+    /** handler that will be used to process errors and warnings during unmarshal */
+    private ValidationEventHandler eventHandler = 
+        new DefaultValidationEventHandler();
+    
+    /** whether or not the unmarshaller will validate */
+    protected boolean validating = false;
+
+    /**
+     * XMLReader that will be used to parse a document.
+     */
+    private XMLReader reader = null;
+
+    /**
+     * Obtains a configured XMLReader.
+     * 
+     * This method is used when the client-specified
+     * {@link SAXSource} object doesn't have XMLReader.
+     * 
+     * {@link Unmarshaller} is not re-entrant, so we will
+     * only use one instance of XMLReader.
+     */
+    protected XMLReader getXMLReader() throws JAXBException {
+        if(reader==null) {
+            try {
+                SAXParserFactory parserFactory;
+                parserFactory = SAXParserFactory.newInstance();
+                parserFactory.setNamespaceAware(true);
+                // there is no point in asking a validation because 
+                // there is no guarantee that the document will come with
+                // a proper schemaLocation.
+                parserFactory.setValidating(false);
+                reader = parserFactory.newSAXParser().getXMLReader();
+            } catch( ParserConfigurationException e ) {
+                throw new JAXBException(e);
+            } catch( SAXException e ) {
+                throw new JAXBException(e);
+            }
+        }
+        return reader;
+    }
+    
+    public Object unmarshal( Source source ) throws JAXBException {
+        if( source == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+        }
+        
+        if(source instanceof SAXSource)
+            return unmarshal( (SAXSource)source );
+        if(source instanceof StreamSource)
+            return unmarshal( streamSourceToInputSource((StreamSource)source));
+        if(source instanceof DOMSource)
+            return unmarshal( ((DOMSource)source).getNode() );
+        
+        // we don't handle other types of Source
+        throw new IllegalArgumentException();
+    }
+
+    // use the client specified XMLReader contained in the SAXSource.
+    private Object unmarshal( SAXSource source ) throws JAXBException {
+        
+        XMLReader r = source.getXMLReader();
+        if( r == null )
+            r = getXMLReader();
+        
+        return unmarshal( r, source.getInputSource() );
+    }
+
+    /**
+     * Unmarshals an object by using the specified XMLReader and the InputSource.
+     * 
+     * The callee should call the setErrorHandler method of the XMLReader
+     * so that errors are passed to the client-specified ValidationEventHandler.
+     */
+    protected abstract Object unmarshal( XMLReader reader, InputSource source ) throws JAXBException;
+    
+    public final Object unmarshal( InputSource source ) throws JAXBException {
+        if( source == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+        }
+
+        return unmarshal( getXMLReader(), source );
+    }
+        
+
+    private Object unmarshal( String url ) throws JAXBException {
+        return unmarshal( new InputSource(url) );
+    }
+    
+    public final Object unmarshal( URL url ) throws JAXBException {
+        if( url == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "url" ) );
+        }
+
+        return unmarshal( url.toExternalForm() );
+    }
+    
+    public final Object unmarshal( File f ) throws JAXBException {
+        if( f == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "file" ) );
+        }
+
+        try {
+            return unmarshal(new BufferedInputStream(new FileInputStream(f)));
+        } catch( FileNotFoundException e ) {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+    }
+    
+    public final Object unmarshal( java.io.InputStream is ) 
+        throws JAXBException {
+            
+        if( is == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "is" ) );
+        }
+
+        InputSource isrc = new InputSource( is );
+        return unmarshal( isrc );
+    }
+
+    public final Object unmarshal( Reader reader ) throws JAXBException {
+        if( reader == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "reader" ) );
+        }
+
+        InputSource isrc = new InputSource( reader );
+        return unmarshal( isrc );
+    }
+
+
+    private static InputSource streamSourceToInputSource( StreamSource ss ) {
+        InputSource is = new InputSource();
+        is.setSystemId( ss.getSystemId() );
+        is.setByteStream( ss.getInputStream() );
+        is.setCharacterStream( ss.getReader() );
+        
+        return is;
+    }
+    
+    
+    /**
+     * Indicates whether or not the Unmarshaller is configured to validate
+     * during unmarshal operations.
+     * <p>
+     * <i><b>Note:</b> I named this method isValidating() to stay in-line
+     * with JAXP, as opposed to naming it getValidating(). </i>
+     *
+     * @return true if the Unmarshaller is configured to validate during
+     *        unmarshal operations, false otherwise
+     * @throws JAXBException if an error occurs while retrieving the validating
+     *        flag
+     */
+    public boolean isValidating() throws JAXBException {
+        return validating;
+    }
+    
+    /**
+     * Allow an application to register a validation event handler.
+     * <p>
+     * The validation event handler will be called by the JAXB Provider if any
+     * validation errors are encountered during calls to any of the
+     * {@code unmarshal} methods.  If the client application does not register
+     * a validation event handler before invoking the unmarshal methods, then
+     * all validation events will be silently ignored and may result in
+     * unexpected behaviour.
+     *
+     * @param handler the validation event handler
+     * @throws JAXBException if an error was encountered while setting the
+     *        event handler
+     */
+    public void setEventHandler(ValidationEventHandler handler) 
+        throws JAXBException {
+        
+        if( handler == null ) {
+            eventHandler = new DefaultValidationEventHandler();
+        } else {
+            eventHandler = handler;
+        }
+    }
+    
+    /**
+     * Specifies whether or not the Unmarshaller should validate during
+     * unmarshal operations. By default, the {@code Unmarshaller} does
+     * not validate.
+     * <p>
+     * This method may only be invoked before or after calling one of the
+     * unmarshal methods.
+     *
+     * @param validating true if the Unmarshaller should validate during
+     *       unmarshal, false otherwise
+     * @throws JAXBException if an error occurred while enabling or disabling
+     * validation at unmarshal time
+     */
+    public void setValidating(boolean validating) throws JAXBException {
+        this.validating = validating;
+    }
+    
+    /**
+     * Return the current event handler or the default event handler if one
+     * hasn't been set.
+     *
+     * @return the current ValidationEventHandler or the default event handler
+     *        if it hasn't been set
+     * @throws JAXBException if an error was encountered while getting the
+     *        current event handler
+     */
+    public ValidationEventHandler getEventHandler() throws JAXBException {
+        return eventHandler;
+    }
+    
+    
+    /**
+     * Creates an UnmarshalException from a SAXException.
+     * 
+     * This is an utility method provided for the derived classes.
+     * 
+     * <p>
+     * When a provider-implemented ContentHandler wants to throw a
+     * JAXBException, it needs to wrap the exception by a SAXException.
+     * If the unmarshaller implementation blindly wrap SAXException
+     * by JAXBException, such an exception will be a JAXBException
+     * wrapped by a SAXException wrapped by another JAXBException.
+     * This is silly.
+     * 
+     * <p>
+     * This method checks the nested exception of SAXException
+     * and reduce those excessive wrapping.
+     * 
+     * @return the resulting UnmarshalException
+     */
+    protected UnmarshalException createUnmarshalException( SAXException e ) {
+        // check the nested exception to see if it's an UnmarshalException
+        Exception nested = e.getException();
+        if(nested instanceof UnmarshalException)
+            return (UnmarshalException)nested;
+        
+        if(nested instanceof RuntimeException)
+            // typically this is an unexpected exception,
+            // just throw it rather than wrap it, so that the full stack
+            // trace can be displayed.
+            throw (RuntimeException)nested;
+                
+        
+        // otherwise simply wrap it
+        if(nested!=null)
+            return new UnmarshalException(nested);
+        else
+            return new UnmarshalException(e);
+    }
+    
+    /**
+     * Default implementation of the setProperty method always 
+     * throws PropertyException since there are no required
+     * properties. If a provider needs to handle additional 
+     * properties, it should override this method in a derived class.
+     */
+    public void setProperty( String name, Object value )
+        throws PropertyException {
+
+        if( name == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+        }
+
+        throw new PropertyException(name, value);
+    }
+    
+    /**
+     * Default implementation of the getProperty method always 
+     * throws PropertyException since there are no required
+     * properties. If a provider needs to handle additional 
+     * properties, it should override this method in a derived class.
+     */
+    public Object getProperty( String name )
+        throws PropertyException {
+            
+        if( name == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+        }
+
+        throw new PropertyException(name);
+    }
+    
+    public Object unmarshal(XMLEventReader reader) throws JAXBException {
+        
+        throw new UnsupportedOperationException();
+    }
+
+    public Object unmarshal(XMLStreamReader reader) throws JAXBException {
+        
+        throw new UnsupportedOperationException();
+    }
+
+    public <T> JAXBElement<T> unmarshal(Node node, Class<T> expectedType) throws JAXBException {
+        throw new UnsupportedOperationException();
+    }
+
+    public <T> JAXBElement<T> unmarshal(Source source, Class<T> expectedType) throws JAXBException {
+        throw new UnsupportedOperationException();
+    }
+
+    public <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> expectedType) throws JAXBException {
+        throw new UnsupportedOperationException();
+    }
+
+    public <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> expectedType) throws JAXBException {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setSchema(Schema schema) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Schema getSchema() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAdapter(XmlAdapter adapter) {
+        if(adapter==null)
+            throw new IllegalArgumentException();
+        setAdapter((Class)adapter.getClass(),adapter);
+    }
+
+    public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
+        throw new UnsupportedOperationException();
+    }
+
+    public <A extends XmlAdapter> A getAdapter(Class<A> type) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) {
+        throw new UnsupportedOperationException();
+    }
+
+    public AttachmentUnmarshaller getAttachmentUnmarshaller() {
+        throw new UnsupportedOperationException();
+    }
+
+    public void setListener(Listener listener) {
+        throw new UnsupportedOperationException();
+    }
+
+    public Listener getListener() {
+        throw new UnsupportedOperationException();
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
new file mode 100644
index 0000000..51e0f20
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import org.w3c.dom.Node;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.ValidationEventLocator;
+import java.net.URL;
+
+/**
+ * <p>
+ * JAXB 1.0 only default validation event handler. This is the default 
+ * handler for all objects created from a JAXBContext that is managing
+ * schema-derived code generated by a JAXB 1.0 binding compiler. 
+ *
+ * <p>
+ * This handler causes the unmarshal and validate operations to fail on the first
+ * error or fatal error.
+ * 
+ * <p>
+ * This handler is not the default handler for JAXB mapped classes following 
+ * JAXB 2.0 or later versions. Default validation event handling has changed 
+ * and is specified in  {@link javax.xml.bind.Unmarshaller} and 
+ * {@link javax.xml.bind.Marshaller}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @see javax.xml.bind.Unmarshaller
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @since 1.6, JAXB 1.0
+ */
+public class DefaultValidationEventHandler implements ValidationEventHandler {
+    
+    public boolean handleEvent( ValidationEvent event ) {
+        
+        if( event == null ) {
+            throw new IllegalArgumentException();
+        }
+
+        // calculate the severity prefix and return value        
+        String severity = null;
+        boolean retVal = false;
+        switch ( event.getSeverity() ) {
+            case ValidationEvent.WARNING:
+                severity = Messages.format( Messages.WARNING );
+                retVal = true; // continue after warnings
+                break;
+            case ValidationEvent.ERROR:
+                severity = Messages.format( Messages.ERROR );
+                retVal = false; // terminate after errors
+                break;
+            case ValidationEvent.FATAL_ERROR:
+                severity = Messages.format( Messages.FATAL_ERROR );
+                retVal = false; // terminate after fatal errors
+                break;
+            default:
+                assert false :
+                    Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+                            event.getSeverity() );
+        }
+        
+        // calculate the location message
+        String location = getLocation( event );
+        
+        System.out.println( 
+            Messages.format( Messages.SEVERITY_MESSAGE,
+                             severity,
+                             event.getMessage(),
+                             location ) );
+        
+        // fail on the first error or fatal error
+        return retVal;
+    }
+
+    /**
+     * Calculate a location message for the event
+     * 
+     */
+    private String getLocation(ValidationEvent event) {
+        StringBuffer msg = new StringBuffer();
+        
+        ValidationEventLocator locator = event.getLocator();
+        
+        if( locator != null ) {
+            
+            URL url = locator.getURL();
+            Object obj = locator.getObject();
+            Node node = locator.getNode();
+            int line = locator.getLineNumber();
+            
+            if( url!=null || line!=-1 ) {
+                msg.append( "line " + line );
+                if( url!=null )
+                    msg.append( " of " + url );
+            } else if( obj != null ) {
+                msg.append( " obj: " + obj.toString() );
+            } else if( node != null ) {
+                msg.append( " node: " + node.toString() );
+            }
+        } else {
+            msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
+        } 
+        
+        return msg.toString();
+    }
+}
+
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/Messages.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/Messages.java
new file mode 100644
index 0000000..d9b4079
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/Messages.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+    static String format( String property ) {
+        return format( property, null );
+    }
+    
+    static String format( String property, Object arg1 ) {
+        return format( property, new Object[]{arg1} );
+    }
+    
+    static String format( String property, Object arg1, Object arg2 ) {
+        return format( property, new Object[]{arg1,arg2} );
+    }
+    
+    static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+        return format( property, new Object[]{arg1,arg2,arg3} );
+    }
+    
+    // add more if necessary.
+    
+    /** Loads a string resource and formats it with specified arguments. */
+    static String format( String property, Object[] args ) {
+        String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+        return MessageFormat.format(text,args);
+    }
+    
+//
+//
+// Message resources
+//
+//
+    static final String INPUTSTREAM_NOT_NULL = // 0 args
+        "AbstractUnmarshallerImpl.ISNotNull";
+        
+    static final String MUST_BE_BOOLEAN = // 1 arg
+        "AbstractMarshallerImpl.MustBeBoolean";
+       
+    static final String MUST_BE_STRING = // 1 arg
+        "AbstractMarshallerImpl.MustBeString";
+        
+    static final String SEVERITY_MESSAGE = // 3 args
+        "DefaultValidationEventHandler.SeverityMessage";
+
+    static final String LOCATION_UNAVAILABLE = // 0 args
+        "DefaultValidationEventHandler.LocationUnavailable";
+        
+    static final String UNRECOGNIZED_SEVERITY = // 1 arg
+        "DefaultValidationEventHandler.UnrecognizedSeverity";
+        
+    static final String WARNING = // 0 args
+        "DefaultValidationEventHandler.Warning";
+
+    static final String ERROR = // 0 args
+        "DefaultValidationEventHandler.Error";
+
+    static final String FATAL_ERROR = // 0 args
+        "DefaultValidationEventHandler.FatalError";
+        
+    static final String ILLEGAL_SEVERITY = // 0 args
+        "ValidationEventImpl.IllegalSeverity";
+        
+    static final String MUST_NOT_BE_NULL = // 1 arg
+        "Shared.MustNotBeNull";
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
new file mode 100644
index 0000000..ce41b7c
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the NotIdentifiableEvent interface.
+ * 
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 
+ * @see javax.xml.bind.NotIdentifiableEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since 1.6, JAXB 1.0
+ */
+public class NotIdentifiableEventImpl
+    extends ValidationEventImpl
+    implements javax.xml.bind.NotIdentifiableEvent {
+
+    /**
+     * Create a new NotIdentifiableEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public NotIdentifiableEventImpl( int _severity, String _message,
+                                      ValidationEventLocator _locator) {
+            
+        super(_severity, _message, _locator);
+    }
+
+    /**
+     * Create a new NotIdentifiableEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @param _linkedException An optional linked exception that may provide
+     * additional information about the event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public NotIdentifiableEventImpl( int _severity, String _message,
+                                      ValidationEventLocator _locator,
+                                      Throwable _linkedException) {
+            
+        super(_severity, _message, _locator, _linkedException);
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
new file mode 100644
index 0000000..78fce06
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.ParseConversionEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the ParseConversionEvent interface.
+ * 
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 
+ * @see javax.xml.bind.ParseConversionEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since 1.6, JAXB 1.0
+ */
+public class ParseConversionEventImpl
+    extends ValidationEventImpl
+    implements ParseConversionEvent {
+
+    /**
+     * Create a new ParseConversionEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public ParseConversionEventImpl( int _severity, String _message,
+                                      ValidationEventLocator _locator) {
+            
+        super(_severity, _message, _locator);
+    }
+
+    /**
+     * Create a new ParseConversionEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @param _linkedException An optional linked exception that may provide
+     * additional information about the event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public ParseConversionEventImpl( int _severity, String _message,
+                                      ValidationEventLocator _locator,
+                                      Throwable _linkedException) {
+            
+        super(_severity, _message, _locator, _linkedException);
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
new file mode 100644
index 0000000..5a2485b
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.PrintConversionEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the PrintConversionEvent interface.
+ * 
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul> 
+ * @see javax.xml.bind.PrintConversionEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since 1.6, JAXB 1.0
+ */
+public class PrintConversionEventImpl
+    extends ValidationEventImpl
+    implements PrintConversionEvent {
+
+    /**
+     * Create a new PrintConversionEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public PrintConversionEventImpl( int _severity, String _message,
+                                      ValidationEventLocator _locator) {
+            
+        super(_severity, _message, _locator);
+    }
+
+    /**
+     * Create a new PrintConversionEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @param _linkedException An optional linked exception that may provide
+     * additional information about the event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public PrintConversionEventImpl( int _severity, String _message,
+                                      ValidationEventLocator _locator,
+                                      Throwable _linkedException) {
+            
+        super(_severity, _message, _locator, _linkedException);
+    }
+
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
new file mode 100644
index 0000000..88cafcf
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import java.text.MessageFormat;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the ValidationEvent interface.
+ * 
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul> 
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since 1.6, JAXB 1.0
+ */
+public class ValidationEventImpl implements ValidationEvent
+{
+    
+    /**
+     * Create a new ValidationEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public ValidationEventImpl( int _severity, String _message, 
+                                 ValidationEventLocator _locator ) {
+        
+        this(_severity,_message,_locator,null);
+    }
+
+    /**
+     * Create a new ValidationEventImpl.
+     * 
+     * @param _severity The severity value for this event.  Must be one of
+     * ValidationEvent.WARNING, ValidationEvent.ERROR, or 
+     * ValidationEvent.FATAL_ERROR
+     * @param _message The text message for this event - may be null.
+     * @param _locator The locator object for this event - may be null.
+     * @param _linkedException An optional linked exception that may provide
+     * additional information about the event - may be null.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public ValidationEventImpl( int _severity, String _message, 
+                                 ValidationEventLocator _locator, 
+                                 Throwable _linkedException ) {
+    
+        setSeverity( _severity );
+        this.message = _message;
+        this.locator = _locator;
+        this.linkedException = _linkedException;
+    }
+    
+    private int severity;
+    private String message;
+    private Throwable linkedException;
+    private ValidationEventLocator locator;
+    
+    public int getSeverity() {
+        return severity;
+    }
+    
+    
+    /**
+     * Set the severity field of this event.  
+     * 
+     * @param _severity Must be one of ValidationEvent.WARNING, 
+     * ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
+     * @throws IllegalArgumentException if an illegal severity field is supplied
+     */
+    public void setSeverity( int _severity ) {
+        
+        if( _severity != ValidationEvent.WARNING && 
+            _severity != ValidationEvent.ERROR && 
+            _severity != ValidationEvent.FATAL_ERROR ) {
+                throw new IllegalArgumentException( 
+                    Messages.format( Messages.ILLEGAL_SEVERITY ) );
+        }
+
+        this.severity = _severity;
+    }
+    
+    public String getMessage() {
+        return message;
+    }
+    /**
+     * Set the message field of this event.
+     * 
+     * @param _message String message - may be null.
+     */
+    public void setMessage( String _message ) {
+        this.message = _message;
+    }
+    
+    public Throwable getLinkedException() {
+        return linkedException;
+    }
+    /**
+     * Set the linked exception field of this event.
+     * 
+     * @param _linkedException Optional linked exception - may be null.
+     */
+    public void setLinkedException( Throwable _linkedException ) {
+        this.linkedException = _linkedException;
+    }
+    
+    public ValidationEventLocator getLocator() {
+        return locator;
+    }
+    /**
+     * Set the locator object for this event.
+     * 
+     * @param _locator The locator - may be null.
+     */
+    public void setLocator( ValidationEventLocator _locator ) {
+        this.locator = _locator;
+    }
+    
+    /**
+     * Returns a string representation of this object in a format
+     * helpful to debugging.
+     * 
+     * @see Object#equals(Object)
+     */
+    public String toString() {
+        String s;
+        switch(getSeverity()) {
+        case WARNING:   s="WARNING";break;
+        case ERROR: s="ERROR";break;
+        case FATAL_ERROR: s="FATAL_ERROR";break;
+        default: s=String.valueOf(getSeverity());break;
+        }
+        return MessageFormat.format("[severity={0},message={1},locator={2}]",
+            new Object[]{
+                s,
+                getMessage(),
+                getLocator()
+            });
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
new file mode 100644
index 0000000..139b000
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.helpers;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.text.MessageFormat;
+
+import javax.xml.bind.ValidationEventLocator;
+import org.w3c.dom.Node;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Default implementation of the ValidationEventLocator interface.
+ * 
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEventLocator interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul> 
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since 1.6, JAXB 1.0
+ */
+public class ValidationEventLocatorImpl implements ValidationEventLocator
+{
+    /**
+     * Creates an object with all fields unavailable.
+     */
+    public ValidationEventLocatorImpl() {
+    }
+
+    /** 
+     * Constructs an object from an org.xml.sax.Locator. 
+     * 
+     * The object's ColumnNumber, LineNumber, and URL become available from the 
+     * values returned by the locator's getColumnNumber(), getLineNumber(), and
+     * getSystemId() methods respectively. Node, Object, and Offset are not 
+     * available. 
+     * 
+     * @param loc the SAX Locator object that will be used to populate this
+     * event locator.
+     * @throws IllegalArgumentException if the Locator is null
+     */
+    public ValidationEventLocatorImpl( Locator loc ) {
+        if( loc == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "loc" ) );
+        }
+
+        this.url = toURL(loc.getSystemId());
+        this.columnNumber = loc.getColumnNumber();
+        this.lineNumber = loc.getLineNumber();
+    }
+
+    /** 
+     * Constructs an object from the location information of a SAXParseException. 
+     * 
+     * The object's ColumnNumber, LineNumber, and URL become available from the 
+     * values returned by the locator's getColumnNumber(), getLineNumber(), and
+     * getSystemId() methods respectively. Node, Object, and Offset are not 
+     * available. 
+     * 
+     * @param e the SAXParseException object that will be used to populate this
+     * event locator.
+     * @throws IllegalArgumentException if the SAXParseException is null
+     */
+    public ValidationEventLocatorImpl( SAXParseException e ) {
+        if( e == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "e" ) );
+        }
+
+        this.url = toURL(e.getSystemId());
+        this.columnNumber = e.getColumnNumber();
+        this.lineNumber = e.getLineNumber();
+    }
+
+    /** 
+     * Constructs an object that points to a DOM Node. 
+     * 
+     * The object's Node becomes available.  ColumnNumber, LineNumber, Object, 
+     * Offset, and URL are not available.
+     * 
+     * @param _node the DOM Node object that will be used to populate this
+     * event locator.
+     * @throws IllegalArgumentException if the Node is null
+     */
+    public ValidationEventLocatorImpl(Node _node) {
+        if( _node == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "_node" ) );
+        }
+
+        this.node = _node;
+    }
+
+    /** 
+     * Constructs an object that points to a JAXB content object. 
+     * 
+     * The object's Object becomes available. ColumnNumber, LineNumber, Node, 
+     * Offset, and URL are not available.
+     * 
+     * @param _object the Object that will be used to populate this
+     * event locator.
+     * @throws IllegalArgumentException if the Object is null
+     */
+    public ValidationEventLocatorImpl(Object _object) {
+        if( _object == null ) {
+            throw new IllegalArgumentException(
+                Messages.format( Messages.MUST_NOT_BE_NULL, "_object" ) );
+        }
+
+        this.object = _object;
+    }
+    
+    /** Converts a system ID to an URL object. */
+    private static URL toURL( String systemId ) {
+        try {
+            return new URL(systemId);
+        } catch( MalformedURLException e ) {
+            // TODO: how should we handle system id here?
+            return null;    // for now
+        }
+    }
+    
+    private URL url = null;
+    private int offset = -1;
+    private int lineNumber = -1;
+    private int columnNumber = -1;
+    private Object object = null;
+    private Node node = null;
+    
+    
+    /**
+     * @see javax.xml.bind.ValidationEventLocator#getURL()
+     */
+    public URL getURL() {
+        return url;
+    }    
+    
+    /**
+     * Set the URL field on this event locator.  Null values are allowed.
+     * 
+     * @param _url the url
+     */
+    public void setURL( URL _url ) {
+        this.url = _url;
+    }    
+    
+    /**
+     * @see javax.xml.bind.ValidationEventLocator#getOffset()
+     */
+    public int getOffset() {
+        return offset;
+    }
+    
+    /**
+     * Set the offset field on this event locator.  
+     * 
+     * @param _offset the offset
+     */
+    public void setOffset( int _offset ) {
+        this.offset = _offset;
+    }
+    
+    /**
+     * @see javax.xml.bind.ValidationEventLocator#getLineNumber()
+     */
+    public int getLineNumber() {
+        return lineNumber;
+    }
+    
+    /**
+     * Set the lineNumber field on this event locator.
+     * 
+     * @param _lineNumber the line number
+     */
+    public void setLineNumber( int _lineNumber ) {
+        this.lineNumber = _lineNumber;
+    }
+    
+    /**
+     * @see javax.xml.bind.ValidationEventLocator#getColumnNumber()
+     */
+    public int getColumnNumber() {
+        return columnNumber;
+    }
+    
+    /**
+     * Set the columnNumber field on this event locator.
+     * 
+     * @param _columnNumber the column number
+     */
+    public void setColumnNumber( int _columnNumber ) {
+        this.columnNumber = _columnNumber;
+    }
+    
+    /**
+     * @see javax.xml.bind.ValidationEventLocator#getObject()
+     */
+    public Object getObject() {
+        return object;
+    }
+    
+    /**
+     * Set the Object field on this event locator.  Null values are allowed.
+     * 
+     * @param _object the java content object
+     */
+    public void setObject( Object _object ) {
+        this.object = _object;
+    }
+    
+    /**
+     * @see javax.xml.bind.ValidationEventLocator#getNode()
+     */
+    public Node getNode() {
+        return node;
+    }
+    
+    /**
+     * Set the Node field on this event locator.  Null values are allowed.
+     * 
+     * @param _node the Node
+     */
+    public void setNode( Node _node ) {
+        this.node = _node;
+    }
+    
+    /**
+     * Returns a string representation of this object in a format
+     * helpful to debugging.
+     * 
+     * @see Object#equals(Object)
+     */
+    public String toString() {
+        return MessageFormat.format("[node={0},object={1},url={2},line={3},col={4},offset={5}]",
+            getNode(),
+            getObject(),
+            getURL(),
+            String.valueOf(getLineNumber()),
+            String.valueOf(getColumnNumber()),
+            String.valueOf(getOffset()));
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/helpers/package-info.java b/jaxb-api/src/main/java/javax/xml/bind/helpers/package-info.java
new file mode 100644
index 0000000..91753dc
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/helpers/package-info.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * <B>JAXB Provider Use Only:</b> Provides partial default implementations for
+ * some of the <code>javax.xml.bind</code> interfaces.
+ *
+ * <p>
+ * JAXB Providers can extend these classes and implement the abstract
+ * methods.
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind.helpers;
diff --git a/jaxb-api/src/main/java/javax/xml/bind/package-info.java b/jaxb-api/src/main/java/javax/xml/bind/package-info.java
new file mode 100644
index 0000000..249c5fa
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/package-info.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * Provides a runtime binding framework for client applications including
+ * unmarshalling, marshalling, and validation capabilities.
+ * <p>
+ * <p>
+ * <code>JAXBContext</code> is the client-entry point to the runtime binding
+ * framework.
+ * <p>
+ * <p>
+ * <h2>Package Specification</h2>
+ * <p>
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ * <p>
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind;
diff --git a/jaxb-api/src/main/java/javax/xml/bind/util/JAXBResult.java b/jaxb-api/src/main/java/javax/xml/bind/util/JAXBResult.java
new file mode 100644
index 0000000..8739af0
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/util/JAXBResult.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.util;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.transform.sax.SAXResult;
+
+/**
+ * JAXP {@link javax.xml.transform.Result} implementation
+ * that unmarshals a JAXB object.
+ * 
+ * <p>
+ * This utility class is useful to combine JAXB with
+ * other Java/XML technologies.
+ * 
+ * <p>
+ * The following example shows how to use JAXB to unmarshal a document
+ * resulting from an XSLT transformation.
+ * 
+ * <blockquote>
+ *    <pre>
+ *       JAXBResult result = new JAXBResult(
+ *         JAXBContext.newInstance("org.acme.foo") );
+ *       
+ *       // set up XSLT transformation
+ *       TransformerFactory tf = TransformerFactory.newInstance();
+ *       Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+ *       
+ *       // run transformation
+ *       t.transform(new StreamSource("document.xml"),result);
+ * 
+ *       // obtain the unmarshalled content tree
+ *       Object o = result.getResult();
+ *    </pre>
+ * </blockquote>
+ * 
+ * <p>
+ * The fact that JAXBResult derives from SAXResult is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXResult.
+ * 
+ * <p>
+ * In particular it shall never attempt to call the setHandler, 
+ * setLexicalHandler, and setSystemId methods.
+ * 
+ * @author
+ * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 1.6
+ */
+public class JAXBResult extends SAXResult {
+
+    /**
+     * Creates a new instance that uses the specified
+     * JAXBContext to unmarshal.
+     * 
+     * @param context The JAXBContext that will be used to create the
+     * necessary Unmarshaller.  This parameter must not be null.
+     * @exception JAXBException if an error is encountered while creating the
+     * JAXBResult or if the context parameter is null.
+     */
+    public JAXBResult( JAXBContext context ) throws JAXBException {
+        this( ( context == null ) ? assertionFailed() : context.createUnmarshaller() );
+    }
+    
+    /**
+     * Creates a new instance that uses the specified
+     * Unmarshaller to unmarshal an object.
+     * 
+     * <p>
+     * This JAXBResult object will use the specified Unmarshaller
+     * instance. It is the caller's responsibility not to use the
+     * same Unmarshaller for other purposes while it is being
+     * used by this object.
+     * 
+     * <p>
+     * The primary purpose of this method is to allow the client
+     * to configure Unmarshaller. Unless you know what you are doing,
+     * it's easier and safer to pass a JAXBContext.
+     * 
+     * @param _unmarshaller the unmarshaller.  This parameter must not be null.
+     * @throws JAXBException if an error is encountered while creating the
+     * JAXBResult or the Unmarshaller parameter is null.
+     */
+    public JAXBResult( Unmarshaller _unmarshaller ) throws JAXBException {
+        if( _unmarshaller == null )
+            throw new JAXBException( 
+                Messages.format( Messages.RESULT_NULL_UNMARSHALLER ) );
+            
+        this.unmarshallerHandler = _unmarshaller.getUnmarshallerHandler();
+        
+        super.setHandler(unmarshallerHandler);
+    }
+    
+    /**
+     * Unmarshaller that will be used to unmarshal
+     * the input documents.
+     */
+    private final UnmarshallerHandler unmarshallerHandler;
+
+    /**
+     * Gets the unmarshalled object created by the transformation.
+     * 
+     * @return
+     *      Always return a non-null object.
+     * 
+     * @exception IllegalStateException
+     * 	if this method is called before an object is unmarshalled.
+     * 
+     * @exception JAXBException
+     *      if there is any unmarshalling error.
+     *      Note that the implementation is allowed to throw SAXException
+     *      during the parsing when it finds an error.
+     */
+    public Object getResult() throws JAXBException {
+        return unmarshallerHandler.getResult();
+    }
+    
+    /**
+     * Hook to throw exception from the middle of a contructor chained call
+     * to this
+     */
+    private static Unmarshaller assertionFailed() throws JAXBException {
+        throw new JAXBException( Messages.format( Messages.RESULT_NULL_CONTEXT ) );
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/util/JAXBSource.java b/jaxb-api/src/main/java/javax/xml/bind/util/JAXBSource.java
new file mode 100644
index 0000000..dc4469d
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/util/JAXBSource.java
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.util;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.transform.sax.SAXSource;
+import org.xml.sax.XMLFilter;
+
+/**
+ * JAXP {@link javax.xml.transform.Source} implementation
+ * that marshals a JAXB-generated object.
+ * 
+ * <p>
+ * This utility class is useful to combine JAXB with
+ * other Java/XML technologies.
+ * 
+ * <p>
+ * The following example shows how to use JAXB to marshal a document
+ * for transformation by XSLT.
+ * 
+ * <blockquote>
+ *    <pre>
+ *       MyObject o = // get JAXB content tree
+ *       
+ *       // jaxbContext is a JAXBContext object from which 'o' is created.
+ *       JAXBSource source = new JAXBSource( jaxbContext, o );
+ *       
+ *       // set up XSLT transformation
+ *       TransformerFactory tf = TransformerFactory.newInstance();
+ *       Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+ *       
+ *       // run transformation
+ *       t.transform(source,new StreamResult(System.out));
+ *    </pre>
+ * </blockquote>
+ * 
+ * <p>
+ * The fact that JAXBSource derives from SAXSource is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXSource. In particular,
+ * the setXMLReader and setInputSource methods shall never be called.
+ * The XMLReader object obtained by the getXMLReader method shall
+ * be used only for parsing the InputSource object returned by
+ * the getInputSource method.
+ * 
+ * <p>
+ * Similarly the InputSource object obtained by the getInputSource
+ * method shall be used only for being parsed by the XMLReader object
+ * returned by the getXMLReader.
+ *
+ * @author
+ * 	Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
+ * @since 1.6
+ */
+public class JAXBSource extends SAXSource {
+
+    /**
+     * Creates a new {@link javax.xml.transform.Source} for the given content object.
+     * 
+     * @param   context
+     *      JAXBContext that was used to create
+     *      <code>contentObject</code>. This context is used
+     *      to create a new instance of marshaller and must not be null.
+     * @param   contentObject
+     *      An instance of a JAXB-generated class, which will be
+     *      used as a {@link javax.xml.transform.Source} (by marshalling it into XML).  It must
+     *      not be null.
+     * @throws JAXBException if an error is encountered while creating the
+     * JAXBSource or if either of the parameters are null.
+     */
+    public JAXBSource( JAXBContext context, Object contentObject ) 
+        throws JAXBException {
+            
+        this( 
+            ( context == null ) ? 
+                assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTEXT ) ) : 
+                context.createMarshaller(),
+                
+            ( contentObject == null ) ? 
+                assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTENT ) ) : 
+                contentObject);
+    }
+    
+    /**
+     * Creates a new {@link javax.xml.transform.Source} for the given content object.
+     * 
+     * @param   marshaller
+     *      A marshaller instance that will be used to marshal
+     *      <code>contentObject</code> into XML. This must be
+     *      created from a JAXBContext that was used to build
+     *      <code>contentObject</code> and must not be null.
+     * @param   contentObject
+     *      An instance of a JAXB-generated class, which will be
+     *      used as a {@link javax.xml.transform.Source} (by marshalling it into XML).  It must
+     *      not be null.
+     * @throws JAXBException if an error is encountered while creating the
+     * JAXBSource or if either of the parameters are null.
+     */
+    public JAXBSource( Marshaller marshaller, Object contentObject ) 
+        throws JAXBException {
+            
+        if( marshaller == null )
+            throw new JAXBException( 
+                Messages.format( Messages.SOURCE_NULL_MARSHALLER ) );
+                
+        if( contentObject == null )
+            throw new JAXBException( 
+                Messages.format( Messages.SOURCE_NULL_CONTENT ) );
+            
+        this.marshaller = marshaller;
+        this.contentObject = contentObject;
+        
+        super.setXMLReader(pseudoParser);
+        // pass a dummy InputSource. We don't care
+        super.setInputSource(new InputSource());
+    }
+    
+    private final Marshaller marshaller;
+    private final Object contentObject;
+    
+    // this object will pretend as an XMLReader.
+    // no matter what parameter is specified to the parse method,
+    // it just parse the contentObject.
+    private final XMLReader pseudoParser = new XMLReader() {
+        public boolean getFeature(String name) throws SAXNotRecognizedException {
+            if(name.equals("http://xml.org/sax/features/namespaces"))
+                return true;
+            if(name.equals("http://xml.org/sax/features/namespace-prefixes"))
+                return false;
+            throw new SAXNotRecognizedException(name);
+        }
+
+        public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
+            if(name.equals("http://xml.org/sax/features/namespaces") && value)
+                return;
+            if(name.equals("http://xml.org/sax/features/namespace-prefixes") && !value)
+                return;
+            throw new SAXNotRecognizedException(name);
+        }
+
+        public Object getProperty(String name) throws SAXNotRecognizedException {
+            if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+                return lexicalHandler;
+            }
+            throw new SAXNotRecognizedException(name);
+        }
+
+        public void setProperty(String name, Object value) throws SAXNotRecognizedException {
+            if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+                this.lexicalHandler = (LexicalHandler)value;
+                return;
+            }
+            throw new SAXNotRecognizedException(name);
+        }
+
+        private LexicalHandler lexicalHandler;
+
+        // we will store this value but never use it by ourselves.
+        private EntityResolver entityResolver;
+        public void setEntityResolver(EntityResolver resolver) {
+            this.entityResolver = resolver;
+        }
+        public EntityResolver getEntityResolver() {
+            return entityResolver;
+        }
+
+        private DTDHandler dtdHandler;
+        public void setDTDHandler(DTDHandler handler) {
+            this.dtdHandler = handler;
+        }
+        public DTDHandler getDTDHandler() {
+            return dtdHandler;
+        }
+
+        // SAX allows ContentHandler to be changed during the parsing,
+        // but JAXB doesn't. So this repeater will sit between those
+        // two components.
+        private XMLFilter repeater = new XMLFilterImpl();
+
+        public void setContentHandler(ContentHandler handler) {
+            repeater.setContentHandler(handler);
+        }
+        public ContentHandler getContentHandler() {
+            return repeater.getContentHandler();
+        }
+
+        private ErrorHandler errorHandler;
+        public void setErrorHandler(ErrorHandler handler) {
+            this.errorHandler = handler;
+        }
+        public ErrorHandler getErrorHandler() {
+            return errorHandler;
+        }
+
+        public void parse(InputSource input) throws SAXException {
+            parse();
+        }
+
+        public void parse(String systemId) throws SAXException {
+            parse();
+        }
+
+        public void parse() throws SAXException {
+            // parses a content object by using the given marshaller
+            // SAX events will be sent to the repeater, and the repeater
+            // will further forward it to an appropriate component.
+            try {
+                marshaller.marshal( contentObject, (XMLFilterImpl)repeater );
+            } catch( JAXBException e ) {
+                // wrap it to a SAXException
+                SAXParseException se =
+                    new SAXParseException( e.getMessage(),
+                        null, null, -1, -1, e );
+
+                // if the consumer sets an error handler, it is our responsibility
+                // to notify it.
+                if(errorHandler!=null)
+                    errorHandler.fatalError(se);
+
+                // this is a fatal error. Even if the error handler
+                // returns, we will abort anyway.
+                throw se;
+            }
+        }
+    };
+
+    /**
+     * Hook to throw exception from the middle of a contructor chained call
+     * to this
+     */
+    private static Marshaller assertionFailed( String message ) 
+        throws JAXBException {
+            
+        throw new JAXBException( message );
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/util/Messages.java b/jaxb-api/src/main/java/javax/xml/bind/util/Messages.java
new file mode 100644
index 0000000..6789c80
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/util/Messages.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.util;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+    static String format( String property ) {
+        return format( property, null );
+    }
+    
+    static String format( String property, Object arg1 ) {
+        return format( property, new Object[]{arg1} );
+    }
+    
+    static String format( String property, Object arg1, Object arg2 ) {
+        return format( property, new Object[]{arg1,arg2} );
+    }
+    
+    static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+        return format( property, new Object[]{arg1,arg2,arg3} );
+    }
+    
+    // add more if necessary.
+    
+    /** Loads a string resource and formats it with specified arguments. */
+    static String format( String property, Object[] args ) {
+        String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+        return MessageFormat.format(text,args);
+    }
+    
+//
+//
+// Message resources
+//
+//
+    static final String UNRECOGNIZED_SEVERITY = // 1 arg
+        "ValidationEventCollector.UnrecognizedSeverity";
+
+    static final String RESULT_NULL_CONTEXT = // 0 args
+        "JAXBResult.NullContext";
+
+    static final String RESULT_NULL_UNMARSHALLER = // 0 arg
+        "JAXBResult.NullUnmarshaller";
+        
+    static final String SOURCE_NULL_CONTEXT = // 0 args
+        "JAXBSource.NullContext";
+
+    static final String SOURCE_NULL_CONTENT = // 0 arg
+        "JAXBSource.NullContent";
+        
+    static final String SOURCE_NULL_MARSHALLER = // 0 arg
+        "JAXBSource.NullMarshaller";
+        
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/util/ValidationEventCollector.java b/jaxb-api/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
new file mode 100644
index 0000000..6df2e4c
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind.util;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * {@link javax.xml.bind.ValidationEventHandler ValidationEventHandler} 
+ * implementation that collects all events.
+ * 
+ * <p>
+ * To use this class, create a new instance and pass it to the setEventHandler
+ * method of the Validator, Unmarshaller, Marshaller class.  After the call to 
+ * validate or unmarshal completes, call the getEvents method to retrieve all 
+ * the reported errors and warnings.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since 1.6, JAXB 1.0
+ */
+public class ValidationEventCollector implements ValidationEventHandler
+{
+    private final List<ValidationEvent> events = new ArrayList<ValidationEvent>();
+     
+    /**
+     * Return an array of ValidationEvent objects containing a copy of each of 
+     * the collected errors and warnings.
+     * 
+     * @return
+     *      a copy of all the collected errors and warnings or an empty array
+     *      if there weren't any
+     */
+    public ValidationEvent[] getEvents() {
+        return events.toArray(new ValidationEvent[events.size()]);
+    }
+    
+    /**
+     * Clear all collected errors and warnings.
+     */
+    public void reset() {
+        events.clear();
+    }
+    
+    /**
+     * Returns true if this event collector contains at least one 
+     * ValidationEvent.
+     *
+     * @return true if this event collector contains at least one 
+     *         ValidationEvent, false otherwise
+     */
+    public boolean hasEvents() {
+        return !events.isEmpty();
+    }
+    
+    public boolean handleEvent( ValidationEvent event ) {        
+        events.add(event);
+
+        boolean retVal = true;
+        switch( event.getSeverity() ) {
+            case ValidationEvent.WARNING:
+                retVal = true; // continue validation
+                break;
+            case ValidationEvent.ERROR:
+                retVal = true; // continue validation
+                break;
+            case ValidationEvent.FATAL_ERROR:
+                retVal = false; // halt validation
+                break;
+            default:
+                _assert( false, 
+                         Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+                                 event.getSeverity() ) );
+                break;
+        }
+        
+        return retVal;
+    }
+
+    private static void _assert( boolean b, String msg ) {
+        if( !b ) {
+            throw new InternalError( msg );
+        }
+    }
+}
diff --git a/jaxb-api/src/main/java/javax/xml/bind/util/package-info.java b/jaxb-api/src/main/java/javax/xml/bind/util/package-info.java
new file mode 100644
index 0000000..d26fc70
--- /dev/null
+++ b/jaxb-api/src/main/java/javax/xml/bind/util/package-info.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * Useful client utility classes.
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li><a href="https://jaxb.java.net/">JAXB Specification</a>
+ * </ul>
+ *
+ * <h2>Related Documentation</h2>
+ * <p>
+ * For overviews, tutorials, examples, guides, and tool documentation,
+ * please see:
+ * <ul>
+ * <li>The <a href="https://jaxb.java.net/">JAXB Website</a>
+ * </ul>
+ *
+ * @see <a href="https://jaxb.java.net/">JAXB Website</a>
+ */
+package javax.xml.bind.util;
diff --git a/jaxb-api/src/main/java/module-info.java b/jaxb-api/src/main/java/module-info.java
new file mode 100644
index 0000000..907d2f5
--- /dev/null
+++ b/jaxb-api/src/main/java/module-info.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+module java.xml.bind {
+    requires transitive java.activation;
+    requires transitive java.xml;
+    requires java.logging;
+    requires java.desktop;
+
+    exports javax.xml.bind;
+    exports javax.xml.bind.annotation;
+    exports javax.xml.bind.annotation.adapters;
+    exports javax.xml.bind.attachment;
+    exports javax.xml.bind.helpers;
+    exports javax.xml.bind.util;
+
+    uses javax.xml.bind.JAXBContextFactory;
+}
diff --git a/jaxb-api/src/main/mr-jar/javax/xml/bind/ModuleUtil.java b/jaxb-api/src/main/mr-jar/javax/xml/bind/ModuleUtil.java
new file mode 100644
index 0000000..d50e007
--- /dev/null
+++ b/jaxb-api/src/main/mr-jar/javax/xml/bind/ModuleUtil.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0, which is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package javax.xml.bind;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.Module;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Propagates openness of JAXB annottated classess packages to JAXB impl module.
+ *
+ * @author Roman Grigoriadi
+ */
+class ModuleUtil {
+
+    private static Logger logger = Logger.getLogger("javax.xml.bind");
+
+    /**
+     * Resolves classes from context path.
+     * Only one class per package is needed to access its {@link java.lang.Module}
+     */
+    static Class[] getClassesFromContextPath(String contextPath, ClassLoader classLoader) throws JAXBException {
+        List<Class> classes = new ArrayList<>();
+        if (contextPath == null || contextPath.isEmpty()){
+          return classes.toArray(new Class[]{});
+        }
+        
+        String [] tokens = contextPath.split(":"); 
+        for (String pkg : tokens){
+
+           // look for ObjectFactory and load it
+           final Class<?> o;
+           try {
+               o = classLoader.loadClass(pkg+".ObjectFactory");
+               classes.add(o);
+               continue;
+           } catch (ClassNotFoundException e) {
+               // not necessarily an error
+           }
+              
+           // look for jaxb.index and load the list of classes
+           try {
+               final Class firstByJaxbIndex = findFirstByJaxbIndex(pkg, classLoader);
+               if (firstByJaxbIndex != null) {
+                   classes.add(firstByJaxbIndex);
+               }
+           } catch (IOException e) {
+               throw new JAXBException(e);
+           }
+        }
+
+        if (logger.isLoggable(Level.FINE)) {
+            logger.log(Level.FINE, "Resolved classes from context path: {0}", classes);
+        }
+        return classes.toArray(new Class[]{});
+    }
+
+    /**
+     * Find first class in package by {@code jaxb.index} file.
+     */
+    static Class findFirstByJaxbIndex(String pkg, ClassLoader classLoader) throws IOException, JAXBException {
+        final String resource = pkg.replace('.', '/') + "/jaxb.index";
+        final InputStream resourceAsStream = classLoader.getResourceAsStream(resource);
+
+        if (resourceAsStream == null) {
+            return null;
+        }
+
+        BufferedReader in =
+                new BufferedReader(new InputStreamReader(resourceAsStream, "UTF-8"));
+        try {
+            String className = in.readLine();
+            while (className != null) {
+                className = className.trim();
+                if (className.startsWith("#") || (className.length() == 0)) {
+                    className = in.readLine();
+                    continue;
+                }
+
+                try {
+                    return classLoader.loadClass(pkg + '.' + className);
+                } catch (ClassNotFoundException e) {
+                    throw new JAXBException(Messages.format(Messages.ERROR_LOAD_CLASS, className, pkg), e);
+                }
+
+            }
+        } finally {
+            in.close();
+        }
+        return null;
+    }
+
+    /**
+     * Implementation may be defined in other module than {@code java.xml.bind}. In that case openness
+     * {@linkplain Module#isOpen open} of classes should be delegated to implementation module.
+     *
+     * @param classes used to resolve module for {@linkplain Module#addOpens(String, Module)}
+     * @param factorySPI used to resolve {@link Module} of the implementation.
+     *
+     * @throws JAXBException if ony of a classes package is not open to {@code java.xml.bind} module.
+     */
+    public static void delegateAddOpensToImplModule(Class[] classes, Class<?> factorySPI) throws JAXBException {
+        final Module implModule = factorySPI.getModule();
+
+        Module jaxbModule = JAXBContext.class.getModule();
+
+        for (Class cls : classes) {
+            Class jaxbClass = cls.isArray() ?
+                cls.getComponentType() : cls;
+
+            final Module classModule = jaxbClass.getModule();
+            final String packageName = jaxbClass.getPackageName();
+            //no need for unnamed and java.base types
+            if (!classModule.isNamed() || classModule.getName().equals("java.base")) {
+                continue;
+            }
+            //report error if they are not open to java.xml.bind
+            if (!classModule.isOpen(packageName, jaxbModule)) {
+                throw new JAXBException(Messages.format(Messages.JAXB_CLASSES_NOT_OPEN,
+                                                        packageName, jaxbClass.getName(), classModule.getName()));
+            }
+            //propagate openness to impl module
+            classModule.addOpens(packageName, implModule);
+            if (logger.isLoggable(Level.FINE)) {
+                logger.log(Level.FINE, "Propagating openness of package {0} in {1} to {2}.",
+                           new String[]{ packageName, classModule.getName(), implModule.getName() });
+            }
+        }
+    }
+
+}
diff --git a/jaxb-api/src/main/resources/META-INF/LICENSE.txt b/jaxb-api/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..c739f78
--- /dev/null
+++ b/jaxb-api/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,29 @@
+
+    Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
+   
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+   
+      - Redistributions of source code must retain the above copyright
+        notice, this list of conditions and the following disclaimer.
+   
+      - Redistributions in binary form must reproduce the above copyright
+        notice, this list of conditions and the following disclaimer in the
+        documentation and/or other materials provided with the distribution.
+   
+      - Neither the name of the Eclipse Foundation, Inc. nor the names of its
+        contributors may be used to endorse or promote products derived
+        from this software without specific prior written permission.
+   
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/jaxb-api/src/main/resources/javax/xml/bind/Messages.properties b/jaxb-api/src/main/resources/javax/xml/bind/Messages.properties
new file mode 100644
index 0000000..4a2ff60
--- /dev/null
+++ b/jaxb-api/src/main/resources/javax/xml/bind/Messages.properties
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Distribution License v. 1.0, which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+ContextFinder.ProviderNotFound = \
+	Provider {0} not found
+
+ContextFinder.DefaultProviderNotFound = \
+	Implementation of JAXB-API has not been found on module path or classpath.
+	
+ContextFinder.CouldNotInstantiate = \
+	Provider {0} could not be instantiated: {1}	
+
+ContextFinder.CantFindPropertiesFile = \
+	Unable to locate jaxb.properties for package {0}
+	
+ContextFinder.CantMixProviders = \
+	You may not mix JAXB Providers on the context path
+	
+ContextFinder.MissingProperty = \
+	jaxb.properties in package {0} does not contain the {1} property.
+
+ContextFinder.NoPackageInContextPath = \
+    No package name is given
+
+ContextFinder.ErrorLoadClass = \
+    Error loading class {0} listed in {1}, make sure that entries are accessable \
+    on CLASSPATH and of the form ClassName or OuterClass.InnerClass \
+    not ClassName.class or fully.qualified.ClassName
+
+PropertyException.NameValue = \
+	name: {0} value: {1}
+	
+DatatypeConverter.ConverterMustNotBeNull = \
+	The DatatypeConverterInterface parameter must not be null
+	
+JAXBContext.IllegalCast = \
+    ClassCastException: attempting to cast {0} to {1}.  Please make sure that you are specifying the proper ClassLoader.    
+
+JAXBClasses.notOpen = \
+    Package {0} with JAXB class {1} defined in a module {2} must be open to at least java.xml.bind module.
diff --git a/jaxb-api/src/main/resources/javax/xml/bind/helpers/Messages.properties b/jaxb-api/src/main/resources/javax/xml/bind/helpers/Messages.properties
new file mode 100644
index 0000000..83b1821
--- /dev/null
+++ b/jaxb-api/src/main/resources/javax/xml/bind/helpers/Messages.properties
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Distribution License v. 1.0, which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+AbstractUnmarshallerImpl.ISNotNull = \
+	InputStream can not be null
+
+AbstractMarshallerImpl.MustBeBoolean = \
+	{0} must be boolean
+	 
+AbstractMarshallerImpl.MustBeString = \
+	{0} must be a String
+	
+
+DefaultValidationEventHandler.SeverityMessage = \
+	DefaultValidationEventHandler: {0} {1} \n\
+\ \ \ \ \ Location: {2}
+
+DefaultValidationEventHandler.LocationUnavailable = \
+	unavailable
+	
+DefaultValidationEventHandler.UnrecognizedSeverity = \
+	Unrecognized event severity field "{0}"
+
+DefaultValidationEventHandler.Warning = \
+	[WARNING]:
+
+DefaultValidationEventHandler.Error = \
+	[ERROR]:
+
+DefaultValidationEventHandler.FatalError = \
+	[FATAL_ERROR]:
+	
+ValidationEventImpl.IllegalSeverity = \
+	Illegal severity
+	
+Shared.MustNotBeNull = \
+	{0} parameter must not be null
+	
+	
diff --git a/jaxb-api/src/main/resources/javax/xml/bind/util/Messages.properties b/jaxb-api/src/main/resources/javax/xml/bind/util/Messages.properties
new file mode 100644
index 0000000..78cf455
--- /dev/null
+++ b/jaxb-api/src/main/resources/javax/xml/bind/util/Messages.properties
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2003, 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Distribution License v. 1.0, which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+ValidationEventCollector.UnrecognizedSeverity = \
+	Unrecognized event severity field "{0}"
+	
+JAXBResult.NullContext = \
+	JAXBContext can not be null
+	
+JAXBResult.NullUnmarshaller = \
+	Unmarshaller can not be null
+	
+JAXBSource.NullContext = \
+	JAXBContext can not be null
+	
+JAXBSource.NullContent = \
+	Content object can not be null
+	
+JAXBSource.NullMarshaller = \
+	Marshaller can not be null
+	
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0326d66
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,211 @@
+<?xml version="1.0"?>
+<!--
+
+    Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Distribution License v. 1.0, which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: BSD-3-Clause
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.eclipse.ee4j</groupId>
+        <artifactId>project</artifactId>
+        <version>1.0.1</version>
+    </parent>
+
+    <groupId>javax.xml.bind</groupId>
+    <artifactId>jaxb-api-parent</artifactId>
+    <version>2.3.2-SNAPSHOT</version>
+    <packaging>pom</packaging>
+    <name>Java Architecture for XML Binding</name>
+    <description>JAXB (JSR 222) API</description>
+    <url>https://github.com/eclipse-ee4j/jaxb-api</url>
+
+    <scm>
+        <connection>scm:git:git://github.com/eclipse-ee4j/jaxb-api.git</connection>
+        <developerConnection>scm:git:git@github.com:eclipse-ee4j/jaxb-api.git</developerConnection>
+        <url>https://github.com/eclipse-ee4j/jaxb-api.git</url>
+        <tag>HEAD</tag>
+    </scm>
+
+    <licenses>
+        <license>
+            <name>Eclipse Distribution License - v 1.0</name>
+            <url>http://www.eclipse.org/org/documents/edl-v10.php</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <developers>
+        <developer>
+            <name>Roman Grigoriadi</name>
+            <email>roman.grigoriadi@oracle.com</email>
+            <organization>Oracle Corporation</organization>
+        </developer>
+    </developers>
+
+    <organization>
+        <name>Oracle Corporation</name>
+        <url>http://www.oracle.com/</url>
+    </organization>
+
+    <issueManagement>
+        <system>github</system>
+        <url>https://github.com/eclipse-ee4j/jaxb-api/issues</url>
+    </issueManagement>
+
+    <mailingLists>
+        <mailingList>
+            <name>Eclipse Project for JAXB mailing list</name>
+            <post>jaxb-dev@eclipse.org</post>
+            <subscribe>https://accounts.eclipse.org/mailing-list/jaxb-dev</subscribe>
+            <unsubscribe>https://accounts.eclipse.org/mailing-list/jaxb-dev</unsubscribe>
+            <archive>https://dev.eclipse.org/mhonarc/lists/jaxb-dev</archive>
+        </mailingList>
+    </mailingLists>
+
+    <properties>
+        <release.spec.feedback>javaee-spec@javaee.groups.io</release.spec.feedback>
+        <release.spec.date>Jul 2017</release.spec.date>
+        <findbugs.exclude>${project.basedir}/exclude.xml</findbugs.exclude>
+        <findbugs.threshold>Low</findbugs.threshold>
+        <mrjar.sourceDirectory>${project.basedir}/src/main/mr-jar</mrjar.sourceDirectory>
+        <mrjar.build.outputDirectory>${project.build.directory}/classes-mrjar</mrjar.build.outputDirectory>
+        <extension.name>javax.xml.bind</extension.name>
+        <spec.version>2.3</spec.version>
+        <impl.version>0</impl.version>
+        <activation.version>1.2.0</activation.version>
+        <config.dir>${project.basedir}/etc/config</config.dir>
+    </properties>
+
+    <modules>
+        <module>jaxb-api</module>
+        <module>jaxb-api-test</module>
+    </modules>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>javax.activation</groupId>
+                <artifactId>javax.activation-api</artifactId>
+                <version>${activation.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>3.8.0</version>
+                </plugin>
+                <plugin>
+                    <groupId>org.glassfish.copyright</groupId>
+                    <artifactId>glassfish-copyright-maven-plugin</artifactId>
+                    <version>1.50</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.20</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-release-plugin</artifactId>
+                    <version>2.5.3</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>3.0.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-enforcer-plugin</artifactId>
+                    <version>3.0.0-M2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>3.0.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <version>2.8.2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <version>3.1.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-gpg-plugin</artifactId>
+                    <version>1.6</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                    <compilerArgs>
+                        <arg>-Xlint:all</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.glassfish.copyright</groupId>
+                <artifactId>glassfish-copyright-maven-plugin</artifactId>
+                <configuration>
+                    <templateFile>${config.dir}/edl-copyright.txt</templateFile>
+                    <excludeFile>${config.dir}/copyright-exclude</excludeFile>
+                    <scm>git</scm>
+                    <!-- skip files not under SCM-->
+                    <scmOnly>true</scmOnly>
+                    <!-- turn off warnings -->
+                    <warn>true</warn>
+                    <!-- for use with repair -->
+                    <update>false</update>
+                    <!-- check that year is correct -->
+                    <ignoreYear>false</ignoreYear>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>copyright</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+
+    </build>
+
+   <profiles>
+      <profile>
+            <id>jvnet-release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <configuration>
+                            <additionalJOptions>
+                                <additionalJOption>-Xdoclint:none</additionalJOption>
+                            </additionalJOptions>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
diff --git a/tools/rewrite_poms_git.sh b/tools/rewrite_poms_git.sh
new file mode 100755
index 0000000..315054b
--- /dev/null
+++ b/tools/rewrite_poms_git.sh
@@ -0,0 +1,213 @@
+#!/bin/bash
+#
+# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Distribution License v. 1.0, which is available at
+# http://www.eclipse.org/org/documents/edl-v10.php.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# if option -n ... do not commit
+COMMIT=Y
+RELEASE=false
+
+while getopts ":nv:r" opt; do
+  case $opt in
+    n)
+      COMMIT=N
+      ;;
+    v)
+      CUSTOM_VERSION=${OPTARG}
+      echo "Using custom version: ${CUSTOM_VERSION}"
+      ;;
+    r)
+      RELEASE=true
+      echo "Using release mode, to append buildnumber remove -r flag."
+      ;;
+    \?)
+      echo "Invalid option: -$OPTARG" >&2
+      exit 1
+      ;;
+  esac
+done
+echo "Script will commit changes: [$COMMIT] (pass option -n not to commit)"
+
+CURRENT_VERSION=`cat pom.xml | grep '<version' -m 1 | cut -d ">" -f 2 | cut -d "<" -f 1 | cut -d "-" -f 1`
+echo "Current version: ${CURRENT_VERSION}"
+
+SCRIPT_DIR=$(cd $(dirname $0); pwd -P)
+
+cd $SCRIPT_DIR/.. || {
+	echo >&2 "Cannot change to top of GIT working directory"
+	exit 1
+}
+
+command -v git > /dev/null 2>&1 || {
+	echo >&2 "Cannot locate git executable"
+	exit 1
+}
+
+GIT=$(command -v git 2>&1)
+#GIT=$(command -v echo 2>&1)
+LAST_GIT_COMMIT=$(${GIT} rev-parse --short HEAD) || exit 1
+
+DATESTAMP=`date +%y%m%d.%H%M`
+BUILD_NUMBER=b${DATESTAMP}
+DEVELOPER_VERSION=${CURRENT_VERSION}-SNAPSHOT
+RELEASE_QUALIFIER=${BUILD_NUMBER}
+
+if [ -z "${CUSTOM_VERSION}" ]; then
+  echo "No version specified, reading release version from pom file"
+  RELEASE_VERSION=${CURRENT_VERSION}
+else
+  RELEASE_VERSION=${CUSTOM_VERSION}
+fi;
+
+if [ "${RELEASE}" = true ]; then
+  echo "Release version: ${RELEASE_VERSION}"
+else
+  RELEASE_VERSION="${RELEASE_VERSION}-${RELEASE_QUALIFIER}"
+  echo "Pre-release version: ${RELEASE_VERSION}"
+fi;
+
+
+
+RELEASE_TAG=${RELEASE_VERSION}
+
+cleanup()
+{
+	${GIT} clean -d -f -x
+	exit 1
+}
+
+edit_poms()
+{
+	TMPFILE=`mktemp $TMPDIR/${RELEASE_VERSION}.XXXXXXXX` || cleanup
+	find \
+		$SCRIPT_DIR/../ \
+		-name pom.xml \
+		>> $TMPFILE
+
+	echo "Updating pom files to have release versions ..."
+	while read line
+	do
+		echo -n "Editing $line..."
+		perl -i -pe "s|<version>${DEVELOPER_VERSION}|<version>${RELEASE_VERSION}|g" $line
+		if [ $? -ne 0 ]; then
+			echo "FAILED."
+			echo "Replace versions failed for $line: $!"
+			cleanup
+		fi
+		echo "DONE."
+
+		echo -n "Adding $line to git index..."
+		${GIT} add $line
+		if [ $? -ne 0 ]; then
+			echo "FAILED."
+			echo "git add failed for $line: $!"
+			cleanup
+		fi
+		echo "DONE."
+	done < "$TMPFILE"
+}
+
+function commit_changes() {
+	echo -n "Committing rewritten POMs to git..."
+	${GIT} commit --verbose -m "Preparing for release ${RELEASE_VERSION}"
+	if [ $? -ne 0 ]; then
+		echo "FAILED."
+		echo "git commit failed: $!"
+		cleanup
+	fi
+	echo "DONE."
+
+	echo -n "Preparing tag ${RELEASE_TAG}..."
+	${GIT} tag -m "Tagging for Release ${RELEASE_VERSION}" ${RELEASE_TAG}
+	if [ $? -ne 0 ]; then
+		echo "FAILED."
+		echo "git tag failed: $!"
+		cleanup
+	fi
+	echo "DONE."
+
+	echo -n "Reverting to developer versions..."
+	${GIT} revert --no-edit --no-commit HEAD
+	if [ $? -ne 0 ]; then
+		echo "FAILED."
+		echo "git revert failed: $!"
+		cleanup
+	fi
+	echo "DONE."
+
+	echo -n "Committing rewritten POMs to git..."
+	${GIT} commit --verbose -m "Preparing for development ${DEVELOPER_VERSION}"
+	if [ $? -ne 0 ]; then
+		echo "FAILED."
+		echo "git commit failed: $!"
+		cleanup
+	fi
+	echo "DONE."
+}
+
+push_changes()
+{
+
+	echo -n "Pushing changes..."
+	${GIT} push 
+	if [ $? -ne 0 ]; then
+		${GIT} pull --rebase
+		${GIT} push
+		if [ $? -ne 0 ]; then
+			echo "FAILED."
+			echo "git push failed: $!"
+			cleanup
+		fi
+	fi
+	echo "DONE."
+
+	echo -n "Pushing tag..."
+	${GIT} push origin ${RELEASE_TAG}
+	if [ $? -ne 0 ]; then
+		${GIT} pull --rebase
+		${GIT} push
+		if [ $? -ne 0 ]; then
+			echo "FAILED."
+			echo "git push failed: $!"
+			cleanup
+		fi
+	fi
+	echo "DONE."
+
+}
+
+checkout_tag()
+{
+	echo -n "Checking out tag ${RELEASE_TAG}..."
+	${GIT} checkout ${RELEASE_TAG}
+	if [ $? -ne 0 ]; then
+		echo "FAILED."
+		echo "git checkout failed: $!"
+		cleanup
+	fi
+	echo "DONE."
+}
+
+#############
+
+echo "Rewriting Web Services POM Files"
+echo "DEVELOPER_VERSION = ${DEVELOPER_VERSION}"
+echo "RELEASE_VERSION = ${RELEASE_VERSION}"
+
+${GIT} clean -d -f -x
+
+edit_poms
+
+if [ "$COMMIT" = "Y" ]; then
+    commit_changes
+    push_changes
+    checkout_tag
+fi
+
+exit 0