← All text tools

XML Workbench: XPath Tester and Attribute Cleaner

Test an XPath 1.0 expression on pasted XML and see matching nodes, text values and a highlighted tree, or sort and remove XML attributes and get cleaned XML back.

  • Free
  • No sign-up
  • Works on any device

About XML Workbench: XPath Tester and Attribute Cleaner

This workbench has three jobs on pasted XML. The XPath tester runs your expression with your browser's XPath 1.0 engine and lists every matching node with its type, absolute path and text value, or shows a number, string or boolean result for functions like count() and sum(). A collapsible tree highlights the matches. The attribute sorter orders attributes A to Z or Z to A on every element, and the cleaner removes listed, unlisted, empty or all attributes. Namespace prefixes found in the document work inside expressions.

How to use XML Workbench: XPath Tester and Attribute Cleaner

  1. Paste the XML and choose XPath tester, Sort attributes or Remove or clean attributes.
  2. For XPath type an expression such as //book[price>15]/title; for cleaning list the attribute names or pick a rule.
  3. Read the matches, the tree or the cleaned XML and copy or download the result.

Why use this tool?

Also known as

Frequently asked questions

Which XPath version does the tester use?

XPath 1.0, evaluated by your browser. That means no XPath 2.0 functions such as matches() or sequences, but all the axes, predicates and core functions work.

How do I query a document that uses a default namespace?

XPath 1.0 needs a prefix, so the tool maps the prefix ns to the default namespace. Write //ns:item instead of //item, and use the prefixes declared in the file as they are.

Does sorting attributes change what the XML means?

No, attribute order is not significant in XML. Namespace declarations can stay first, and element order, comments and CDATA sections are kept as they are.

Is XML Workbench: XPath Tester and Attribute Cleaner free?

Yes. XML Workbench: XPath Tester and Attribute Cleaner on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.