in reply to Question about XML::DOM::Lite

I usually use XML::XSH2 for XML manipulation:
create xml ; insert element A into xml ; insert element B into xml/A ; cd xml/A/B ; insert text "C" into . ;