public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
    meta = (GetXMLDataMeta) smi;
    data = (GetXMLDataData) sdi;

    if ( super.init( smi, sdi ) ) {
      data.rownr = 1L;
      data.nrInputFields = meta.getInputFields().length;

      // correct attribute path if needed
      // do it once
      for ( int i = 0; i < data.nrInputFields; i++ ) {
        GetXMLDataField xmlDataField = meta.getInputFields()[i];
        // Resolve variable substitution
        String XPathValue = environmentSubstitute( xmlDataField.getXPath() );
        if ( xmlDataField.getElementType() == GetXMLDataField.ELEMENT_TYPE_ATTRIBUT ) {
          // We have an attribute
          // do we need to add leading @?
          // Only put @ to the last element in path, not in front at all
          int last = XPathValue.lastIndexOf( GetXMLDataMeta.N0DE_SEPARATOR );
          if ( last > -1 ) {
            last++;
            String attribut = XPathValue.substring( last, XPathValue.length() );
            if ( !attribut.startsWith( GetXMLDataMeta.AT ) ) {
              XPathValue = XPathValue.substring( 0, last ) + GetXMLDataMeta.AT + attribut;
            }
          } else {
            if ( !XPathValue.startsWith( GetXMLDataMeta.AT ) ) {
              XPathValue = GetXMLDataMeta.AT + XPathValue;
            }
          }
        }
        xmlDataField.setResolvedXPath( XPathValue );
      }

      data.PathValue = environmentSubstitute( meta.getLoopXPath() );
      if ( Utils.isEmpty( data.PathValue ) ) {
        logError( BaseMessages.getString( PKG, "GetXMLData.Error.EmptyPath" ) );
        return false;
      }
      if ( !data.PathValue.substring( 0, 1 ).equals( GetXMLDataMeta.N0DE_SEPARATOR ) ) {
        data.PathValue = GetXMLDataMeta.N0DE_SEPARATOR + data.PathValue;
      }
      if ( log.isDetailed() ) {
        logDetailed( BaseMessages.getString( PKG, "GetXMLData.Log.LoopXPath", data.PathValue ) );
      }

      data.prunePath = environmentSubstitute( meta.getPrunePath() );
      if ( data.prunePath != null ) {
        if ( Utils.isEmpty( data.prunePath.trim() ) ) {
          data.prunePath = null;
        } else {
          // ensure a leading slash
          if ( !data.prunePath.startsWith( GetXMLDataMeta.N0DE_SEPARATOR ) ) {
            data.prunePath = GetXMLDataMeta.N0DE_SEPARATOR + data.prunePath;
          }
          // check if other conditions apply that do not allow pruning
          if ( meta.isInFields() ) {
            data.prunePath = null; // not possible by design, could be changed later on
          }
        }
      }

      return true;
    }
    return false;
  }
@Test
  public void testGetXMLData_MissingNodesYieldNullValues() throws Exception {
    KettleEnvironment.init();
    System.setProperty( Const.KETTLE_XML_MISSING_TAG_YIELDS_NULL_VALUE, "Y" );

    testGetXMLData( null );
  }