if (qualifiedForSoapHeader && matches(qname)) {
if (value instanceof Node) {
Node domNode = soapHeader.getOwnerDocument().importNode((Node)value, true);
soapHeader.appendChild(domNode);
} else if (value instanceof Configuration) {
Element configElement = new ElementPuller().pull(new StringReader(value.toString()));
Node configNode = soapHeader.getOwnerDocument().importNode(configElement, true);
soapHeader.appendChild(configNode);
} else {
String v = value.toString();
if (SOAPHeadersType.XML.equals(_soapHeadersType)) {
try {
Element xmlElement = new ElementPuller().pull(new StringReader(v));
Node xmlNode = soapHeader.getOwnerDocument().importNode(xmlElement, true);
soapHeader.appendChild(xmlNode);
} catch (Throwable t) {
soapHeader.addChildElement(qname).setValue(v);
}