mediumMultiple ChoiceObjective-mapped
200-901 Practice Question: A developer writes a Python script using ncclient…
A developer writes a Python script using ncclient to retrieve the running configuration from a Cisco IOS XE device. The script fails with an XML parsing error. What is the most likely cause?
⚠ Common exam trap
Cisco often tests the subtle requirement that NETCONF replies must be well-formed XML with a single root element, and candidates mistakenly think the error is due to connectivity or authentication rather than the missing filter.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The script is not filtering the output correctly and receives multiple root elements
The most likely cause is that the script does not filter the NETCONF reply to a specific subtree, so the device returns multiple top-level XML elements (e.g., both <native> and <config>). An XML parser expects a single root element, and receiving multiple roots triggers a parsing error. ncclient's `get_config` with no filter can return the entire configuration as separate elements, violating XML well-formedness.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The script is not filtering the output correctly and receives multiple root elements
Why this is correct
If multiple root elements are returned (e.g., unfiltered), the XML parser will throw an error.
- ✗
The device does not support NETCONF
Why it's wrong here
IOS XE devices typically support NETCONF.
- ✗
The ncclient library version is too old
Why it's wrong here
Version mismatches usually cause capability issues, not XML parsing errors.
- ✗
The username and password are incorrect
Why it's wrong here
Authentication errors would result in a different error (e.g., authentication failure).
Go deeper
Related to this question
About these practice questions
One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.