public static BSimQuery<?> restoreQuery(XmlPullParser parser, LSHVectorFactory vectorFactory)
			throws LSHException {
		String mainName = parser.peek().getName();
		BSimQuery<?> query;
		if (mainName.equals("querynearest")) {
			query = new QueryNearest();
		}
		else if (mainName.equals("querynearestvector")) {
			query = new QueryNearestVector();
		}
		else if (mainName.equals("insert")) {
			query = new InsertRequest();
		}
		else if (mainName.equals("queryinfo")) {
			query = new QueryInfo();
		}
		else if (mainName.equals("update")) {
			query = new QueryUpdate();
		}
		else if (mainName.equals("queryname")) {
			query = new QueryName();
		}
		else if (mainName.equals("delete")) {
			query = new QueryDelete();
		}
		else if (mainName.equals("createdatabase")) {
			query = new CreateDatabase();
		}
		else if (mainName.equals("querychildren")) {
			query = new QueryChildren();
		}
		else if (mainName.equals("querycluster")) {
			query = new QueryCluster();
		}
		else if (mainName.equals("querypair")) {
			query = new QueryPair();
		}
		else if (mainName.equals("installcategory")) {
			query = new InstallCategoryRequest();
		}
		else if (mainName.equals("installmetadata")) {
			query = new InstallMetadataRequest();
		}
		else if (mainName.equals("installtag")) {
			query = new InstallTagRequest();
		}
		else if (mainName.equals("adjustindex")) {
			query = new AdjustVectorIndex();
		}
		else if (mainName.equals("passwordchange")) {
			query = new PasswordChange();
		}
		else if (mainName.equals("prewarmrequest")) {
			query = new PrewarmRequest();
		}
		else {
			throw new LSHException("Unknown query tag: "+mainName);
		}
		query.restoreXml(parser,vectorFactory);
		return query;
	}
Restore a query from a stream
@param parser is the XmlPullParser already queued up with the stream to process
@param vectorFactory is used to generate any vector objects from the XML
@return one of the Query* instances derived from QueryResponseRecord
@throws LSHException for errors creating the command
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/protocol/BSimQuery.java