UPDATE
Based on your comments:
.. .. @Blaise Doughan @CoolBeans , , , xml "String Value" XML . "" . , , . .. , . S
@XmlAnyElement DomHandler . :
# 2
, ? , "@XmlAnyElement", java .
JAXB dom, XmlAnyElement :
XJC
xjc -d out -b bindings.xml dom.xsd
dom.xsd
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.com/default"
targetNamespace="http://www.example.com/default">
<xs:element name="customer">
<xs:complexType>
<xs:sequence>
<xs:element ref="address"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="address">
<xs:complexType>
<xs:attribute name="street" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
bindings.xml
<jxb:bindings
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
version="2.1">
<jxb:bindings schemaLocation="string.xsd">
<jxb:bindings node="//xs:element[@name='customer']/xs:complexType/xs:sequence/xs:element[@ref='address']">
<jxb:dom/>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
Customer @XmlAnyElement:
package com.example._default;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"address"
})
@XmlRootElement(name = "customer")
public class Customer {
@XmlAnyElement
protected Element address;
public Element getAddress() {
return address;
}
public void setAddress(Element value) {
this.address = value;
}
}
, @XmlValue. , :
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD
public class Child {
@XmlValue
private String value;
}
:
<child>String Value</child>
XML- xs: string.
<xs:element name="child" type="xs:string"/>