It depends on the XML schema whether this code is correct. If the schema specifies elementFormDefault=”qualified”, then all elements and subelements are in the targetNamespace of the schema.
If the schema specifies elementFormDefault=”unqualified” or does not specify elementFormDefault, then only the top level element is in the targetNamespace of the schema.
In case elementFormDefault=”qualified” in the schema, change the Java class as following:
FROM:
MbElement firstChild = xmlnscElement.getFirstChild();