src/xml: refractor stuff