XnStatus XnExportedSensorGenerator::EnumerateProductionTrees(xn::Context& context, xn::NodeInfoList& TreesList, xn::EnumerationErrors* pErrors)
{
	XnStatus nRetVal = XN_STATUS_OK;

	XnProductionNodeDescription Description;
	GetDescription(&Description);

	// perform a query to be sure the device we'll find is the same one exported from this DLL.
	xn::Query query;
	query.SetVendor(XN_VENDOR_PRIMESENSE);
	query.SetName(XN_DEVICE_NAME);
	query.SetMinVersion(Description.Version);
	query.SetMaxVersion(Description.Version);

	nRetVal = context.AutoEnumerateOverSingleInput(TreesList, Description, NULL, XN_NODE_TYPE_DEVICE, pErrors, &query);
	XN_IS_STATUS_OK(nRetVal);

	if (!m_bIsAvailableInLowBand)
	{
		xn::NodeInfoList::Iterator it = TreesList.Begin();
		while (it != TreesList.End())
		{
			xn::NodeInfoList::Iterator curr = it;
			it++;

			xn::NodeInfo node = *curr;

			// take sensor node
			xn::NodeInfo sensorNode = *node.GetNeededNodes().Begin();

			XnBool bIsLowBand;
			nRetVal = XnSensorIO::IsSensorLowBandwidth(sensorNode.GetCreationInfo(), &bIsLowBand);
			XN_IS_STATUS_OK(nRetVal);

			if (bIsLowBand)
			{
				// sensor is low band
				nRetVal = TreesList.Remove(curr);
				XN_IS_STATUS_OK(nRetVal);
			}
		}

		if (TreesList.IsEmpty())
		{
			return XN_STATUS_NO_NODE_PRESENT;
		}
	}
	
	return (XN_STATUS_OK);
}