Extract XML elements from source files using Python's standard library with optional xmllint formatting