diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn
index 6c5161d964291bec20cfb19b688455ef0a844a2a..344be930f34b7e45c091fdb54106a4f94936cbdd 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn
@@ -22,7 +22,11 @@ module Pos_070106_form_009 {
       myElement := {myField := 3}
     }
 
-
+	external function enc_MyType(in MyElement pdu) return octetstring
+  	 with { extension "prototype (convert) encode(XER:XER_EXTENDED)" }
+  
+  	external function dec_MyType(in octetstring stream) return MyElement
+  	 with { extension "prototype (convert) decode(XER:XER_EXTENDED)" }
 
     /**
      * @desc The timeout given in seconds after which the test case will be stopped.
@@ -32,23 +36,47 @@ module Pos_070106_form_009 {
     type universal charstring Raw;
 
     type port P message {
-        inout all;
-    }
+        inout Raw;
+    } with {extension "internal"}
 
     type component C {
         port P p;
+		port P p1;
     }
 
     testcase TC_Pos_070106_form_009() runs on C system C {
-        map(self:p, system:p);
 
-        // encode the message
-        p.send(m_msg);
-        log("template should either be rejected by compiler or by runtime latest while encoding");
+		var Raw v_rcv;
+
+        var Raw  v_Raw:="<ns230_1:MyElement xmlns:ns230_1='schema:Pos_070106_form_009' xmlns:ns230_2='schema:Pos_070106_form_009_2'>\n\t<ns230_1:myField>1</ns230_1:myField>\n\t<ns230_1:myField2>\n\t\t<myField>2</myField>\n\t</ns230_1:myField2>\n\t<ns230_2:MyElement>\n\t\t<myField>3</myField>\n\t</ns230_2:MyElement>\n</ns230_1:MyElement>\n\n";
+
+        connect(self:p, self:p1);
+
+		p.send(oct2unichar(enc_MyType(valueof(m_msg))));
 
-        setverdict(fail, "Invalid template should not be encoded");
+		alt {
+            // compare the encoded message with the reference XML file
+            [] p1.check(receive(Raw:?) -> value v_rcv) {
+                log("XML message ", v_rcv);
+                if (match(v_rcv, v_Raw) ) {
+					alt {
+                     	[] p1.receive(Raw:?) {
+							if(match(dec_MyType(unichar2oct(v_rcv)),m_msg))	{
+								setverdict(pass, "Decoded value matches encoded template and reference XML");
+							}
+							else 
+								{setverdict(fail, "XML decoding failure, reason:", dec_MyType(unichar2oct(v_rcv)));}	
+						}
+					}
+                } else {
+                    setverdict(fail, "Unexpected message: ", v_rcv, " expected: ", v_Raw);
+                }
+            }
+            [] p1.receive {
+                setverdict(fail, "Raw decoding failure");
+            }
+        }
 
-        unmap(self:p, system:p);
     }
 
     control {
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml
index b1cf1f2d0774bb1cb0ca78519307f0b6cbbb113c..da328dcdc1a4e464dada14a26e46dc146bba336f 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ns132_1:MyElement xmlns:ns="schema:Neg_070106_form_001"
-              xmlns:ns132_2="schema:Neg_070106_form_001_2">
-  <ns132_1:myField>1</ns132_1:myField>
-  <ns132_1:myField2><myField>2</myField></ns132_1:myField2>
-  <ns132_2:myElement><myField>3</myField></ns132_2:myElement>
-</ns132_1:MyElement>
+<ns230_1:MyElement xmlns:ns="schema:Neg_070106_form_001"
+              xmlns:ns230_2="schema:Neg_070106_form_001_2">
+  <ns230_1:myField>1</ns230_1:myField>
+  <ns230_1:myField2><myField>2</myField></ns230_1:myField2>
+  <ns230_2:myElement><myField>3</myField></ns230_2:myElement>
+</ns230_1:MyElement>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd
index 40993797621432b4e2e2a47dba354322da663d07..00271beecc69c5525eea1245cd27a3aa91fa89c4 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.xsd
@@ -2,15 +2,15 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     targetNamespace="schema:Pos_070106_form_009"
-    xmlns:ns132_1="schema:Pos_070106_form_009"
-    xmlns:ns132_2="schema:Pos_070106_form_009_2">
+    xmlns:ns230_1="schema:Pos_070106_form_009"
+    xmlns:ns230_2="schema:Pos_070106_form_009_2">
   <import namespace="schema:Pos_070106_form_009_2" schemaLocation="Pos_070106_form_009_2.xsd" />
   <element name="MyElement">
 	<complexType>
 		<sequence>
 			<element name="myField" type="integer" />
-			<element name="myField2" type="ns132_2:MyType"/>
-			<element ref="ns132_2:MyElement"/>
+			<element name="myField2" type="ns230_2:MyType"/>
+			<element ref="ns230_2:MyElement"/>
 		</sequence>
 	</complexType>
   </element>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd
index 0b3febb982bd97da75a2d9a890cc41cde222f9fb..4b4756776170b6073ab06a5e4fabc433a81d4b0e 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009_2.xsd
@@ -2,8 +2,8 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
 	elementFormDefault="unqualified" 
 	targetNamespace="schema:Pos_070106_form_009_2"
-	xmlns:ns132_2="schema:Pos_070106_form_009_2">
-	<element name="MyElement" type="ns:MyType" />
+	xmlns:ns230_2="schema:Pos_070106_form_009_2">
+	<element name="MyElement" type="ns230_2:MyType" />
 	<complexType name="MyType">
 		<sequence>
 			<element name="myField" type="integer" />
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn
index b83bcb8694157b80a8e383821c91f207a0f3cdc5..08f961b24547a9c062350de1601e09560a8afcc3 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn
@@ -22,7 +22,11 @@ module Pos_070106_form_010 {
       myElement := {myField := 3}
     }
 
-
+	external function enc_MyType(in MyElement pdu) return octetstring
+  	 with { extension "prototype (convert) encode(XER:XER_EXTENDED)" }
+  
+  	external function dec_MyType(in octetstring stream) return MyElement
+  	 with { extension "prototype (convert) decode(XER:XER_EXTENDED)" }
 
     /**
      * @desc The timeout given in seconds after which the test case will be stopped.
@@ -32,23 +36,46 @@ module Pos_070106_form_010 {
     type universal charstring Raw;
 
     type port P message {
-        inout all;
-    }
+        inout Raw;
+    } with {extension "internal"}
 
     type component C {
         port P p;
+		port P p1;
     }
 
     testcase TC_Pos_070106_form_010() runs on C system C {
-        map(self:p, system:p);
 
-        // encode the message
-        p.send(m_msg);
-        log("template should either be rejected by compiler or by runtime latest while encoding");
+		var Raw v_rcv;
+
+        var Raw  v_Raw:="<ns231_1:MyElement xmlns:ns231_1='schema:Pos_070106_form_010' xmlns:ns231_2='schema:Pos_070106_form_010_2'>\n\t<myField>1</myField>\n\t<myField2>\n\t\t<ns231_2:myField>2</ns231_2:myField>\n\t</myField2>\n\t<ns231_2:MyElement>\n\t\t<ns231_2:myField>3</ns231_2:myField>\n\t</ns231_2:MyElement>\n</ns231_1:MyElement>\n\n";
+
+        connect(self:p, self:p1);
 
-        setverdict(fail, "Invalid template should not be encoded");
+		p.send(oct2unichar(enc_MyType(valueof(m_msg))));
 
-        unmap(self:p, system:p);
+		alt {
+            // compare the encoded message with the reference XML file
+            [] p1.check(receive(Raw:?) -> value v_rcv) {
+                log("XML message ", v_rcv);
+                if (match(v_rcv, v_Raw) ) {
+					alt {
+                     	[] p1.receive(Raw:?) {
+							if(match(dec_MyType(unichar2oct(v_rcv)),m_msg))	{
+								setverdict(pass, "Decoded value matches encoded template and reference XML");
+							}
+							else 
+								{setverdict(fail, "XML decoding failure, reason:", dec_MyType(unichar2oct(v_rcv)));}	
+						}
+					}
+                } else {
+                    setverdict(fail, "Unexpected message: ", v_rcv, " expected: ", v_Raw);
+                }
+            }
+            [] p1.receive {
+                setverdict(fail, "Raw decoding failure");
+            }
+        }
     }
 
     control {
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml
index 392368e33459e9f87a272274b2088b8261674ff0..8242c50dbdb9bd21de59172777fe78258019ee8f 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ns:MyElement xmlns:ns="schema:Neg_070106_form_001"
-              xmlns:ns2="schema:Neg_070106_form_001_2">
+<ns231_1:MyElement xmlns:ns231_1="schema:Neg_070106_form_001"
+              xmlns:ns231_2="schema:Neg_070106_form_001_2">
   <myField>1</myField>
-  <myField2><ns2:myField>2</ns2:myField></myField2>
-  <myElement><ns2:myField>3</ns2:myField></myElement>
-</ns:MyElement>
+  <myField2><ns231_2:myField>2</ns231_2:myField></myField2>
+  <myElement><ns231_2:myField>3</ns231_2:myField></myElement>
+</ns231_1:MyElement>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd
index da2d32b4dfb80955f6f039c3aae3d7e2bf8bf616..091a938a4106f5266f10e329ef1e6b6d6ebfbd50 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.xsd
@@ -2,16 +2,16 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="unqualified"
     targetNamespace="schema:Pos_070106_form_010"
-    xmlns:ns="schema:Pos_070106_form_010"
-    xmlns:ns2="schema:Pos_070106_form_010_2">
+    xmlns:ns231_1="schema:Pos_070106_form_010"
+    xmlns:ns231_2="schema:Pos_070106_form_010_2">
   <import namespace="schema:Pos_070106_form_010_2" schemaLocation="Pos_070106_form_010_2.xsd" />
   <element name="MyElement">
 	<complexType>
 		<sequence>
 			<element name="myField" type="integer" />
-			<element name="myField2" type="ns2:MyType"/>
-			<element ref="ns2:MyElement"/>
+			<element name="myField2" type="ns231_2:MyType"/>
+			<element ref="ns231_2:MyElement"/>
 		</sequence>
 	</complexType>
   </element>
-</schema>
\ No newline at end of file
+</schema>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd
index 375d9a50a84a3b29dc670a536be0aed303ef3a82..d5692517d4b32fc389186582c8bbb337d34d918a 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010_2.xsd
@@ -2,11 +2,11 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
 	elementFormDefault="qualified" 
 	targetNamespace="schema:Pos_070106_form_010_2"
-	xmlns:ns="schema:Pos_070106_form_010_2">
-	<element name="MyElement" type="ns:MyType" />
+	xmlns:ns231_2="schema:Pos_070106_form_010_2">
+	<element name="MyElement" type="ns231_2:MyType" />
 	<complexType name="MyType">
 		<sequence>
 			<element name="myField" type="integer" />
 		</sequence>
 	</complexType>
-</schema>
\ No newline at end of file
+</schema>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn
index 0fb4db726f54eb9377b3cfd40d526b8f929b7faf..0cc13205db21205ba915158a41a4b19d980b53ca 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn
@@ -22,7 +22,11 @@ module Pos_070106_form_011 {
       myElement := {3}
     }
 
-
+	external function enc_MyType(in MyElement pdu) return octetstring
+  	 with { extension "prototype (convert) encode(XER:XER_EXTENDED)" }
+  
+  	external function dec_MyType(in octetstring stream) return MyElement
+  	 with { extension "prototype (convert) decode(XER:XER_EXTENDED)" }
 
     /**
      * @desc The timeout given in seconds after which the test case will be stopped.
@@ -32,23 +36,46 @@ module Pos_070106_form_011 {
     type universal charstring Raw;
 
     type port P message {
-        inout all;
-    }
+        inout Raw;
+    } with {extension "internal"}
 
     type component C {
         port P p;
+		port P p1;
     }
 
     testcase TC_Pos_070106_form_011() runs on C system C {
-        map(self:p, system:p);
 
-        // encode the message
-        p.send(m_msg);
-        log("template should either be rejected by compiler or by runtime latest while encoding");
+      	var Raw v_rcv;
+
+        var Raw  v_Raw:="<ns232_1:MyElement xmlns:ns232_1='schema:Pos_070106_form_011' xmlns:ns232_2='schema:Pos_070106_form_011_2' ns232_1:myField='1'>\n\t<myField2 myField='2'/>\n\t<ns232_2:MyElement myField='3'/>\n</ns232_1:MyElement>\n\n";
+
+        connect(self:p, self:p1);
 
-        setverdict(fail, "Invalid template should not be encoded");
+		p.send(oct2unichar(enc_MyType(valueof(m_msg))));
 
-        unmap(self:p, system:p);
+		alt {
+            // compare the encoded message with the reference XML file
+            [] p1.check(receive(Raw:?) -> value v_rcv) {
+                log("XML message ", v_rcv);
+                if (match(v_rcv, v_Raw) ) {
+					alt {
+                     	[] p1.receive(Raw:?) {
+							if(match(dec_MyType(unichar2oct(v_rcv)),m_msg))	{
+								setverdict(pass, "Decoded value matches encoded template and reference XML");
+							}
+							else 
+								{setverdict(fail, "XML decoding failure, reason:", dec_MyType(unichar2oct(v_rcv)));}	
+						}
+					}
+                } else {
+                    setverdict(fail, "Unexpected message: ", v_rcv, " expected: ", v_Raw);
+                }
+            }
+            [] p1.receive {
+                setverdict(fail, "Raw decoding failure");
+            }
+        }
     }
 
     control {
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml
index d3a09a960e0e8738b4e8e884b0ebe971818fd612..c042e07338b930cb007e9f2cf73ae4da38c5a03c 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ns:MyElement xmlns:ns="schema:Neg_070106_form_001"
-              xmlns:ns2="schema:Neg_070106_form_001_2"
-  ns:myField="1">
-  <ns:myField2>2</ns:myField2>
-  <ns2:MyElement myField="3"/>
-</ns:MyElement>
+<ns232_1:MyElement xmlns:ns232_1="schema:Neg_070106_form_001"
+              xmlns:ns232_2="schema:Neg_070106_form_001_2"
+  ns232_1:myField="1">
+  <ns232_1:myField2>2</ns232_1:myField2>
+  <ns232_2:MyElement myField="3"/>
+</ns232_1:MyElement>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd
index 270421ae3eed3a9221d7c5b019a3c1761c2a2bca..34941b461d40e09fe076d641d74720b58e2f622b 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.xsd
@@ -2,16 +2,16 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
     attributeFormDefault="qualified"
     targetNamespace="schema:Pos_070106_form_011"
-    xmlns:ns="schema:Pos_070106_form_011"
-    xmlns:ns2="schema:Pos_070106_form_011_2">
+    xmlns:ns232_1="schema:Pos_070106_form_011"
+    xmlns:ns232_2="schema:Pos_070106_form_011_2">
   <import namespace="schema:Pos_070106_form_011_2" schemaLocation="Pos_070106_form_011_2.xsd" />
   <element name="MyElement">
 	<complexType>
        <sequence>
-            <element name="myField2" type="ns2:MyType"/>
-            <element ref="ns2:MyElement"/>
+            <element name="myField2" type="ns232_2:MyType"/>
+            <element ref="ns232_2:MyElement"/>
        </sequence>
         <attribute name="myField" type="integer" />
     </complexType>
   </element>
-</schema>
\ No newline at end of file
+</schema>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd
index 167c68be6ea2d9cdb9238c389ffc165dbd10c8a7..f97aef96dd20e1b7989751d1725d35f008ffab07 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011_2.xsd
@@ -2,9 +2,9 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
 	attributeFormDefault="unqualified" 
 	targetNamespace="schema:Pos_070106_form_011_2"
-	xmlns:ns="schema:Pos_070106_form_011_2">
-	<element name="MyElement" type="ns:MyType" />
+	xmlns:ns232_2="schema:Pos_070106_form_011_2">
+	<element name="MyElement" type="ns232_2:MyType" />
     <complexType name="MyType">
        <attribute name="myField" type="integer" />
     </complexType>
-</schema>
\ No newline at end of file
+</schema>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn
index b534c263ee6dda170154ed11110616ccb4469ae2..4add3e02f0781e973a93d83738d1308249a8c1df 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn
@@ -22,7 +22,11 @@ module Pos_070106_form_012 {
       myElement := {3}
     }
 
-
+	external function enc_MyType(in MyElement pdu) return octetstring
+  	 with { extension "prototype (convert) encode(XER:XER_EXTENDED)" }
+  
+  	external function dec_MyType(in octetstring stream) return MyElement
+  	 with { extension "prototype (convert) decode(XER:XER_EXTENDED)" }
 
     /**
      * @desc The timeout given in seconds after which the test case will be stopped.
@@ -32,23 +36,46 @@ module Pos_070106_form_012 {
     type universal charstring Raw;
 
     type port P message {
-        inout all;
-    }
+        inout Raw;
+    } with {extension "internal"}
 
     type component C {
         port P p;
+		port P p1;
     }
 
     testcase TC_Pos_070106_form_012() runs on C system C {
-        map(self:p, system:p);
 
-        // encode the message
-        p.send(m_msg);
-        log("template should either be rejected by compiler or by runtime latest while encoding");
+        var Raw v_rcv;
+
+        var Raw  v_Raw:="<ns233_1:MyElement xmlns:ns233_1='schema:Pos_070106_form_012' xmlns:ns233_2='schema:Pos_070106_form_012_2' myField='1'>\n\t<myField2 ns233_2:myField='2'/>\n\t<ns233_2:MyElement ns233_2:myField='3'/>\n</ns233_1:MyElement>\n\n";
+
+        connect(self:p, self:p1);
 
-        setverdict(fail, "Invalid template should not be encoded");
+		p.send(oct2unichar(enc_MyType(valueof(m_msg))));
 
-        unmap(self:p, system:p);
+		alt {
+            // compare the encoded message with the reference XML file
+            [] p1.check(receive(Raw:?) -> value v_rcv) {
+                log("XML message ", v_rcv);
+                if (match(v_rcv, v_Raw) ) {
+					alt {
+                     	[] p1.receive(Raw:?) {
+							if(match(dec_MyType(unichar2oct(v_rcv)),m_msg))	{
+								setverdict(pass, "Decoded value matches encoded template and reference XML");
+							}
+							else 
+								{setverdict(fail, "XML decoding failure, reason:", dec_MyType(unichar2oct(v_rcv)));}	
+						}
+					}
+                } else {
+                    setverdict(fail, "Unexpected message: ", v_rcv, " expected: ", v_Raw);
+                }
+            }
+            [] p1.receive {
+                setverdict(fail, "Raw decoding failure");
+            }
+        }
     }
 
     control {
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd
index 890710f8187f344ed4e80bf7a1eebefdd5af8275..320d9256810d774469ba1a89fcf24925125f1900 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.xsd
@@ -2,16 +2,16 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
     attributeFormDefault="unqualified"
     targetNamespace="schema:Pos_070106_form_012"
-    xmlns:ns="schema:Pos_070106_form_012"
-    xmlns:ns2="schema:Pos_070106_form_012_2">
+    xmlns:ns233_1="schema:Pos_070106_form_012"
+    xmlns:ns233_2="schema:Pos_070106_form_012_2">
   <import namespace="schema:Pos_070106_form_012_2" schemaLocation="Pos_070106_form_012_2.xsd" />
   <element name="MyElement">
 	<complexType>
 	   <sequence>
-		    <element name="myField2" type="ns2:MyType"/>
-            <element ref="ns2:MyElement"/>
+		    <element name="myField2" type="ns233_2:MyType"/>
+            <element ref="ns233_2:MyElement"/>
 	   </sequence>
         <attribute name="myField" type="integer" />
 	</complexType>
   </element>
-</schema>
\ No newline at end of file
+</schema>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd
index 46cfab008c39162d1a9a059ef095d7d5e720aaf0..526fd058a3b0f288bc54fd7869973c485906f5e4 100644
--- a/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd
+++ b/conformance_test/xml_tests/positive_tests/ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012_2.xsd
@@ -2,9 +2,9 @@
 <schema xmlns="http://www.w3.org/2001/XMLSchema"
 	attributeFormDefault="qualified" 
 	targetNamespace="schema:Pos_070106_form_012_2"
-	xmlns:ns="schema:Pos_070106_form_012_2">
-	<element name="MyElement" type="ns:MyType" />
+	xmlns:ns233_2="schema:Pos_070106_form_012_2">
+	<element name="MyElement" type="ns233_2:MyType" />
     <complexType name="MyType">
-       <attribute name="myField" type="MyAttributeType" />
+       <attribute name="myField" type="integer" />
     </complexType>
-</schema>
\ No newline at end of file
+</schema>
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_009.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_009.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..2088a16fea03d734aacecc35bb3631cee4ab4cdb
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_009.ttcn
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_009.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 13:15:29 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_009.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_009" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_009 {
+
+
+import from XSD all;
+
+
+import from schema_Pos_070106_form_009_2 all;
+
+
+type record MyElement
+{
+	XSD.Integer myField,
+	MyType myField2,
+	schema_Pos_070106_form_009_2.MyElement myElement
+}
+with {
+  variant "element";
+  variant (myElement) "name as capitalized";
+  variant (myElement) "namespace as 'schema:Pos_070106_form_009_2' prefix 'ns230_2'";
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_009' prefix 'ns230_1'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+  variant "elementFormQualified";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_009_2.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_009_2.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..87c248a4f774df36bef8d7729b35bd3bb9797974
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_009_2.ttcn
@@ -0,0 +1,59 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_009_2.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 13:15:29 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_009_2.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_009_2" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_009_2 {
+
+
+import from XSD all;
+
+
+type MyType MyElement
+with {
+  variant "element";
+};
+
+
+type record MyType
+{
+	XSD.Integer myField
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_009_2' prefix 'ns230_2'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_010.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_010.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..00737d8efbfcec70cb6918f3fea75ada10a48728
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_010.ttcn
@@ -0,0 +1,63 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_010.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 11:33:35 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_010.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_010" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_010 {
+
+
+import from XSD all;
+
+
+import from schema_Pos_070106_form_010_2 all;
+
+
+type record MyElement
+{
+	XSD.Integer myField,
+	MyType myField2,
+	schema_Pos_070106_form_010_2.MyElement myElement
+}
+with {
+  variant "element";
+  variant (myElement) "name as capitalized";
+  variant (myElement) "namespace as 'schema:Pos_070106_form_010_2' prefix 'ns231_2'";
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_010' prefix 'ns231_1'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_010_2.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_010_2.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..95512792bc50e5e5c908e2b180ff31496e3f5b92
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_010_2.ttcn
@@ -0,0 +1,60 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_010_2.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 11:33:35 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_010_2.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_010_2" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_010_2 {
+
+
+import from XSD all;
+
+
+type MyType MyElement
+with {
+  variant "element";
+};
+
+
+type record MyType
+{
+	XSD.Integer myField
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_010_2' prefix 'ns231_2'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+  variant "elementFormQualified";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_011.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_011.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..512cbaa84ebbd171fccf8cc71d1b73c4e0f44a6c
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_011.ttcn
@@ -0,0 +1,65 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_011.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 11:44:55 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_011.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_011" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_011 {
+
+
+import from XSD all;
+
+
+import from schema_Pos_070106_form_011_2 all;
+
+
+type record MyElement
+{
+	XSD.Integer myField optional,
+	MyType myField2,
+	schema_Pos_070106_form_011_2.MyElement myElement
+}
+with {
+  variant "element";
+  variant (myField) "attribute";
+  variant (myElement) "name as capitalized";
+  variant (myElement) "namespace as 'schema:Pos_070106_form_011_2' prefix 'ns232_2'";
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_011' prefix 'ns232_1'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+  variant "attributeFormQualified";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_011_2.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_011_2.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..d9b4df726e2efc03d2daafd86bf620e50ca88a36
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_011_2.ttcn
@@ -0,0 +1,62 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_011_2.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 11:44:55 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_011_2.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_011_2" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_011_2 {
+
+
+import from XSD all;
+
+
+type MyType MyElement
+with {
+  variant "element";
+};
+
+
+type record MyType
+{
+	XSD.Integer myField optional
+}
+with {
+  variant (myField) "attribute";
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_011_2' prefix 'ns232_2'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_012.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_012.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..9624e87739be8b46905d0cb3983b444712998a56
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_012.ttcn
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_012.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 11:58:06 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_012.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_012" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_012 {
+
+
+import from XSD all;
+
+
+import from schema_Pos_070106_form_012_2 all;
+
+
+type record MyElement
+{
+	XSD.Integer myField optional,
+	MyType myField2,
+	schema_Pos_070106_form_012_2.MyElement myElement
+}
+with {
+  variant "element";
+  variant (myField) "attribute";
+  variant (myElement) "name as capitalized";
+  variant (myElement) "namespace as 'schema:Pos_070106_form_012_2' prefix 'ns233_2'";
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_012' prefix 'ns233_1'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+}
diff --git a/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_012_2.ttcn b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_012_2.ttcn
new file mode 100644
index 0000000000000000000000000000000000000000..05c72f1b7e969a02f54b2a06f07fe9983c52d5cd
--- /dev/null
+++ b/conformance_test/xml_tests/positive_tests/ATS/xsd_converted/schema_Pos_070106_form_012_2.ttcn
@@ -0,0 +1,63 @@
+/*******************************************************************************
+* Copyright (c) 2000-2017 Ericsson Telecom AB
+*
+* XSD to TTCN-3 Translator version: CRL 113 200/6 R1A                       
+*
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*******************************************************************************/
+//
+//  File:          schema_Pos_070106_form_012_2.ttcn
+//  Description:
+//  References:
+//  Rev:
+//  Prodnr:
+//  Updated:       Wed Jan 11 11:58:06 2017
+//  Contact:       http://ttcn.ericsson.se
+//
+////////////////////////////////////////////////////////////////////////////////
+//	Generated from file(s):
+//	- Pos_070106_form_012_2.xsd
+//			/* xml version = "1.0" encoding = "UTF-8" */
+//			/* targetnamespace = "schema:Pos_070106_form_012_2" */
+////////////////////////////////////////////////////////////////////////////////
+//     Modification header(s):
+//-----------------------------------------------------------------------------
+//  Modified by:
+//  Modification date:
+//  Description:
+//  Modification contact:
+//------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////
+
+
+module schema_Pos_070106_form_012_2 {
+
+
+import from XSD all;
+
+
+type MyType MyElement
+with {
+  variant "element";
+};
+
+
+type record MyType
+{
+	XSD.Integer myField optional
+}
+with {
+  variant (myField) "attribute";
+};
+
+
+}
+with {
+  encode "XML";
+  variant "namespace as 'schema:Pos_070106_form_012_2' prefix 'ns233_2'";
+  variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
+  variant "attributeFormQualified";
+}
diff --git a/conformance_test/xml_tests/positive_tests/XML_tests.cfg b/conformance_test/xml_tests/positive_tests/XML_tests.cfg
index 3abc1b64db8063e58ded7f9370702c38d72c01b5..458221c407e71b6679521345334cff14cf703df6 100644
--- a/conformance_test/xml_tests/positive_tests/XML_tests.cfg
+++ b/conformance_test/xml_tests/positive_tests/XML_tests.cfg
@@ -136,6 +136,10 @@ Pos_070106_form_005.control
 Pos_070106_form_006.control
 Pos_070106_form_007.control
 Pos_070106_form_008.control
+Pos_070106_form_009.control
+Pos_070106_form_010.control
+Pos_070106_form_011.control
+Pos_070106_form_012.control
 Pos_070107_type_001.control
 Pos_070107_type_002.control
 Pos_070107_type_003.control
diff --git a/conformance_test/xml_tests/positive_tests/XML_tests.tpd b/conformance_test/xml_tests/positive_tests/XML_tests.tpd
index cf5f5b909bd542a91f8232479f900d280b5ae220..d47198335eb64b69fbbeccffc3ad7073b7b5d45a 100644
--- a/conformance_test/xml_tests/positive_tests/XML_tests.tpd
+++ b/conformance_test/xml_tests/positive_tests/XML_tests.tpd
@@ -824,6 +824,18 @@
 	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_007.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_007.ttcn"/>
 	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_008/Pos_070106_form_008.ttcn"/>
 	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_008.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_008.ttcn"/>
+	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_009/Pos_070106_form_009.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_009.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_009.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_009_2.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_009_2.ttcn"/>
+	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_010/Pos_070106_form_010.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_010.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_010.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_010_2.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_010_2.ttcn"/>
+	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_011.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_011.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_011.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_011_2.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_011_2.ttcn"/>
+	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_011/Pos_070106_form_012.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070106_form/Pos_070106_form_012/Pos_070106_form_012.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_012.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_012.ttcn"/>
+	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070106_form_012_2.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070106_form_012_2.ttcn"/>
 	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_001/Pos_070107_type_001.ttcn"/>
 	<FileResource projectRelativePath="ATS/xsd_converted/schema_Pos_070107_type_001.ttcn" relativeURI="ATS/xsd_converted/schema_Pos_070107_type_001.ttcn"/>
 	<FileResource projectRelativePath="ATS/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.ttcn" relativeURI="ATS/07_mapping_xsd_components/0701_component_attributes/070107_type/Pos_070107_type_002/Pos_070107_type_002.ttcn"/>
diff --git a/usrguide/SoC_XML_TITAN.docx b/usrguide/SoC_XML_TITAN.docx
index 4972556e5fb03995d39c1602c4781622668c55b3..ce1fc88c0c257b064fe17e2fddf11eeebc799778 100644
Binary files a/usrguide/SoC_XML_TITAN.docx and b/usrguide/SoC_XML_TITAN.docx differ