Here is a very easy to use sample of script to get an xml. Instead of using states, I recommend using handlers…
This article explains the basics of network management, this is a must read before any other network tutorials
Extensible Markup Language (XML) is a human-readable, machine-understandable, general syntax for describing hierarchical data,
applicable to a wide range of applications (databases, e-commerce, Java, web development, etc.).