Remember there's various options for formatting the data fetched from queries. You're using fetchAll which assumes that you want all rows of the query result fetched into an array of rows. This is most appropriate when you know your query is going to return multiple rows, e.g. getting all threads in a forum is definitely likely to be more than a single row so fetchAll is most appropriate there.
However, you know for sure that you want to fetch, at most, a row of data, so instead of fetchAll, you should consider fetchRow. fetchRow will always return the first row it finds (even if there is more than one) in an array that represents that single row, e.g.
PHP:
$category_qry = "
SELECT node_id, title FROM `xf_node`
WHERE node_id = $node_id
";
$node = XenForo_Application::get( 'db' )->fetchRow( $category_qry );
$nodeTitle = $node['title'];
As well as fetchRow, you might be able to do something else here. There is fetchOne. Fetch one will always return the first value, in the first column, in the first row in the result of the query. So, if you were to do:
PHP:
$query = "
SELECT title
FROM xf_node
WHERE node_id = ?
";
$nodeTitle = XenForo_Application::getDb()->fetchOne($query, $node_id);
Notice I've changed the query to only select "title" and I've changed it to use fetchOne. fetchOne will return simply the node title, nothing more, nothing less.
Please also take note of the use of prepared statements. It's best practice to do this with any "input" used in DB queries, especially if the input can be modified by a user. In the above code $node_id is actually passed into the fetchOne call where it is then made safe to use. Note that the second parameter in any of the fetch methods can also accept an array of parameters.
Finally another change I made is how to grab the database object. Using XenForo_Application::getDb() should allow your IDE to resolve that as the appropriate type, so it should suggest/auto complete the methods you can access by using that object.