Every XML Documents Must Have a Root Element and if you want to use the same UnMarshaller for both instances your only possibility is to have a common root element such as:
<root>
<A></A>
</root>
and your xsd File would look like this
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
example for stackoverflow
</xs:documentation>
</xs:annotation>
<xs:element name="root" type="rootType"/>
<xs:complexType name="rootType">
<xs:choice>
<xs:element name="A" type="AType"/>
<xs:element name="B" type="BType"/>
</xs:choice>
</xs:complexType>
... your AType and BType definitions here
</xs:schema>