 
 public class LzXMLTranslator {
 
-static function copyXML (xmlobj, trimwhitespace, nsprefix) {
-    var lfcnode = copyFlashXML(xmlobj, trimwhitespace, nsprefix);
+static function copyXML (xmlobj:XML, trimwhitespace:Boolean, nsprefix:Boolean) :LzDataElementMixin {
+    var lfcnode:LzDataNodeMixin = copyFlashXML(xmlobj, trimwhitespace, nsprefix);
     if (lfcnode == null) {
         trace('LzXMLTranslator.copyXML: lfcnode.children is null', lfcnode);
     }
-    var fc = lfcnode;
-    if ( fc is LzDataText ) {
+    
+    if ( lfcnode is LzDataText ) {
         return null;
     }
-    return fc;
+    
+    return (lfcnode cast LzDataElementMixin);
 }
 
 

//PBR Changed to match swf kernel
//    } else if (node.nodeKind() == 'element') {
      } else {
        var nattrs = node.attributes();
        var cattrs = {};
        for (var i:int = 0; i < nattrs.length(); i++) {
            var key = nsprefix ? nattrs[i].name() : nattrs[i].localName();
            cattrs[key] = nattrs[i];
        }

        var nname = node.localName();
        if (nname && !nsprefix) {
            // strip namespace prefix
            var npos = nname.indexOf(':');
            if (npos >= 0) {
                nname = nname.substring(npos+1);
            }
        }

        lfcnode = new LzDataElement(nname, cattrs);
        var children = node.children();
        var newchildren = [];
        for (var i  = 0; i < children.length(); i++ ) {
            var child = children[i];
            var lfcchild = copyFlashXML(child, trimwhitespace, nsprefix);
            newchildren[i] = lfcchild;
        }
        lfcnode.setChildNodes(newchildren);
    }
    return lfcnode;
}

  * trim whitespace from start and end of string
  * @access private
  */
static function trim( str:String ) :String {
    var whitech:Object = whitespaceChars;
    var len:int = str.length;
    var sindex:int = 0;
    var eindex:int = str.length -1;
    var ch:String;
    while (sindex < len) {
        ch = str.charAt(sindex);
        if (whitech[ch] != true) break;
